A=input().split(".") B=input().split(".") if A>=B: print("YES") else: print("NO")