How are you accessing Yahoo Mail--via their web interface or do you have access via Mail?
If the web interface that should be under Yahoo's control, which would suggest the password you are entering is not the password Yahoo has. Alternatively (but highly unlikely), it might be something in the cahce or cookies for the browser you are using on this Mac.
A way to test this would be to use a different browser temporarily to access Yahoo mail. To isolate things I might try that first on the machine that right now *has* access. It's possible you might have entered a new password and then had an error in copying it down. In that case Yahoo could very well work just fine in that browser, as it would have remembered the "wrong" password and, if you allowed the browser to store passwords, is offering it up each time Yahoo asks for the password.
If you download another browser (Firefox or Chrome if you are using the browsers that shipped with either computer) and then try to access Yahoo Mail on the machine which you believe is working right that should flag things. One strong hint--DO NOT allow the new browser to import passwords from the old one if it offers, since obviously if it pulls that one off it won't prove anything.
While you could accomplish the same thing by typing (not just accepting what the browser fills in) the password you believe is right into the browser on the working computer after logging out, but depending on how you handle that the browser might "forget" the remembered password that Yahoo thinks is right. That would potentially lock you out there as well, so another browser should be a safer way to isolate this issue.
If that is the problem you may be able to get the password from the "working" browser. If so, you'd need to tell us what browser you are using (Safari, Internet Explorer, Firefox, Chrome, etc.) and on what operating system (Mac OSX or Windows). Often there is a way to get the browser to give you (in plain text) the passwords it has remembered for you.
You could also try a different browser on the Mac that won't log in. If Firefox or Chrome also fail that would rule out a problem with Safari or that computer (neither one is going to care what Safari is doing) and point to a more general problem getting into Yahoo on other computers. If they do get in, then we begin to look into what Safari might be retaining on that Mac that is causing the problem.
You can download Firefox by going to:
http://www.getfirefox.com
Chrome can be downloaded from:
http://www.google.com/chrome