It really depends on the use I guess. If you are promoting something that Yahoo or Google is selling such as a Google Adwords account signup or YSM signup, then I would think it would be okay. However, you must get prior approval from them first. If it is in the case of something like Google Payload, then I would seriously doubt they would permit it. Google/Yahoo's logos are registered trademarks of the respective companies. Use of their logo without their permission is most likely a violation of that trademark. Your best option is to just explain to them what you are doing and get permission from the first. If you do it without their permission then you are likely to get a cease and desist letter from their lawyers. Hope that helps. BTW I am no expert in business law or trademar law, so you would really want to seek the advice of an attourney that has knowledge in that area. Hope that helps.
I agree, you should for sure go and contact both companies and outline what you will use their logos for. then get written consent for the use of the images. if you don't you may be okay or you may be not, as quoted, it depends for what for. but if I were you i'd play it on the safe side and just contact the companies and get permission. If its something thats okay (your image use would be fine anyways) then its not a problem, but if its something that they would object to you get to find out then instead of in a cease and desist message