This is already a feature! In the New Yahoo! Mail, if you click on the subject of a message, it will automatically trigger a search for all messages with the same subject. Same goes for the "From" field -- you'll get back all the messages sent by that dude.
If you're using Yahoo! Mail Classic, you can also do these types of searches; in the Search field, enter "subject:invitation " to find all the messages with "invitation" in the subject field.
There are loads of special query terms like this you can use; more are documented at http://help. yahoo.com/ l/us/yahoo/ mail/original/ search/search- 01.html
Hope that helps!