yay -Qqs > yournameforfile.txt
Yay -S --needed - < yournameforfile.txt