t1 = tuple(map(int, input().split('.'))) t2 = tuple(map(int, input().split('.'))) if t1>=t2: print("YES") else: print("NO")