First try to disable any proxies set up in the Control panel > Internet Options > Connections > LAN. Additionally, start Yahoo Messenger but don't log in. Use Preferences > Connections and make sure that everything is configured correctly. Thirdly, check your firewall to see if the Yahoo Messenger application is allowed to communicate with Internet and then log in again. If everything is done correctly, it should work without problems.