This happens to many people, i would blame more Yahoo's connection settings in messenger.
Check and see which connection your set at in your messenger preferences, and toggle between them and see if you get the same logoff's.
try no network detection
if you think you're been booted or someone has your password, change the password or try using a third party chat client that offers better protection aginst bootcodes.
lists of some can be found
here or
here
if you persist to be disconnected on both i would contact your isp and enquire about loss of connection while connected to yahoo!.