This will sort of give you what you want (It indicates YES in the correct "pair")...
=IF(COUNTIFS($C$2:$C$7,C2,$D$2:$D$7,"<>5555",$A$2:$A$7,">="&A2,$B$2:$B$7,"<="&B2)>1,"Yes","No")

I am working on returning blank spaces for you