Hello and welcome to BBB! Yahoo Messenger has been very touchy when it comes to spyware and malware lately. I'd suggest a complete virus and at least 2 separate spyware scans (with different programs such as Ad-Aware and SuperAnti Spyware - both available on
Filehippo. Make sure you have up to date definitions on all of these when you run them, and be sure your browser is closed when you do them. Obviously, get rid of whatever it finds.
There have been many instanced of YM shutting down at different spots and this has helped severl people. It could still be something else going on, but let's eliminate the easiest possibility first.
Let me know how it goes and we'll go from there.