X = list(map(int, input().split("."))) Y = list(map(int, input().split("."))) if X < Y: print("NO") else: print("YES")