First I would try temporarily disabling my software firewall. If Messenger works u know it's your Windows or 3rd party firewall. If that's the case you can try finding that application in your software firewall setting and allow it full access to the big old Internet thang.
If u still can't use Yahoo it could be your router. I would go to:
Advanced/Port forwarding and allow TCP port 5050 (Chat & Messenger)
Other ports of interest:
Insider/Room Lists TCP Port 80: Client Access only
File Transfer TCP Port 80: Server Access.
Your ISP may block this port, as its used for web hosting.
You can change port in Messenger, Preferences, File Transfer.
Voice Chat UDP 5000-5010
TCP 5000-5001: Client Access
If UDP Fails, TCP will be used instead, see below.
WebCam TCP Port 5100: Client Access
Super Webcam TCP Port 5100: Server Access
P2P Instant Messages TCP Port 5101: Server Access
PMs between Buddys may not use the Yahoo! Server, but this is not a requirement.