Welcome to Apple Support Communities.
If your Yahoo account is set up as a POP account, you can set the option "Remove copy from server after retrieving a message" in the Advanced settings of Mail.
See this article for the steps to locate this option:
- In Mail for Mac OS X 10.5 or later, choose Mail > Preferences.
- Click the Accounts tab.
- Select the account for which you wish to change the settings.
- Click the Advanced tab.
- Select the "Remove copy from server after retrieving a message" option.
Also, this article has more information on the options found in the Advanced tab:
Remove copy from server after retrieving a message
Specify when you want to delete received messages from the mail server. You can deselect this option if you need to temporarily access messages from more than one location or computer.
This option is available only for Post Office Protocol (POP) accounts.