list_0 = input().split('.') list_1 = input().split('.') n0 = int(''.join(list_0)) n1 = int(''.join(list_1)) if n0 > n1: print('YES') else: print('NO')