I use conditional formatting to highlight cells orange if the data in them is incorrect. I've entered

=IF(OR(AND((AL2)="Yes"),(AM2="")),AL2="",(AND(AL2="No",AM2<>"")))

In other words, if column AL is blank at all, go orange. Also go orange if AL says "No" but there's something in AM, or if AL says "Yes" but there isn't anything in AM.

However, when AL says 'Yes' and AM is blank, it doesn't go orange. What's wrong with my formula?

I've set it to act on range AM2:AM3000 ish.