For Gmail I have the option to customize synchronization settings.
All messages, New Headers, New messages only.
It doesn't show any such option for Yahoo!
Actually. A better suggestion would be to let Gmail import all your emails from Yahoo and then sync it with your computer using IMAP.