v1 = [int(i) for i in input().split(".")] v2 = [int(i) for i in input().split(".")] print("YES" if v1 > v2 else "NO")