import sys A = input().split(".") B = input().split(".") for y in range(len(B)): while len(B[y]) != len(A[y]): if len(B[y]) > len(A[y]): A[y] += "0" else: B[y] += "0" for x in range(len(B[y])): if int(B[y][x]) > int(A[y][x]): print("NO") sys.exit() if int(B[y][x]) < int(A[y][x]) or (y == len(B) - 1 and x == len(B[y]) - 1 and int(B[y][x]) <= int(A[y][x])): print("YES") sys.exit()