1.Go to Start <Run < type ‘regedit’ to open registry editor.
2.Browse to this registry key:
HKEY_CURRENT_USER\Software\Yahoo\pager\Locale

3.Browse to the ‘Enable Messenger Ad’ section and change the decimal value from 1 to 0.
4.Restart yahoo messenger 9.

iMportant!
this solution is not working for Yahoo 10