def split_comma(i): s_i = i.split('.') a = [int(v) for v in s_i] return a f = input() a = split_comma(f) g = input() b = split_comma(g) c = 100 * a[0] + 10 * a[1] + a[2] d = 100 * b[0] + 10 * b[1] + b[2] if c > d: print('YES') else: print('NO')