The CFAA allows for this.
Yahoo EULA under section 2:
You also understand and agree that the Service may include advertisements and that these advertisements are necessary for Yahoo to provide the Service.
Yahoo EULA under section 16:
You agree that Yahoo shall not be responsible or liable for any loss or damage of any sort incurred as the result of any such dealings or as the result of the presence of such advertisers on the Service.
Ruling in favor of EULAs: Vernor v. Autodesk
We're living in a golden age. All you need is gold. -- D.W. Robertson.