a0=int(input().split(".")) a1=int(input().split(".")) if a1<=a0: print ("YES") else: print ("NO")