a, b, c = map(int, input().split(".")) d, e, f = map(int, input().split(".")) if a * 1000000 + b * 1000 + c >= d * 1000000 + e * 1000 + f: print("YES") else: print("NO")