Hrmm...
Have you try changing the password on your Yahoo Messenger? What version of YM are you using?
The previous suggestions on scanning for trojans would be good. The logging out on it's own and rebooting isn't activity I'd associate with sniffing except for maybe an active sniffer like Ettercap and if you had auto login in place.
Sniffers are hard to stop. Are you at a college when this happens or is this an "at home" thing? DSL? Cable? Dialup?
