If you have a large inbox and need to cleanup existing email you can sort your email by sender:
After sorting by sender, check the box next to emails from them, then use the Move menu to move the email to a folder:
If you have too much email for this process to be efficient, a mail client such as Mozilla Thunderbird with more powerful search and move functions can be used to connect to Yahoo with their IMAP settings to manage your inbox and folders during the cleanup process.