There's no reason to use xargs here, you can simply do:
while read password
do
if [ "$password" = 'qwerty' ]; then
echo 'Nice!'
break
fi
done
And then run it as:
./program.sh < list
If you really want xargs, you can do something like:
for password in "$@"
do
case "$password" in
'qwerty')
echo 'Nice!'
;;
esac
done
And then:
xargs -a list ./program.sh