If you have an email in your inbox from something you are absolutely positive you didn't sign up for directly or indirectly, it is spam.
Examples are emails trying to sell you prescription medications, weight loss pill, penis or breast enlargement products. They usually have website addresses that are random words or letters stuck together. Sometimes real websites will send you email, but won't unsubscribe you no matter how many times you try and how long you wait. That's considered spam too.
If you put a check mark next to it and click Mark As Spam, or click while reading the email, Yahoo will move the email to your Spam folder. Emails like those you mark will start being considered as spam and be automatically sent to your Spam folder.
Only mark those that are actually spam and be sure to check your Spam folder to make sure stuff you want to get in your box doesn't end up there. You can click "Not Spam" on those messages.