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