a = list(input().split('.')) b = list(input().split('.')) a = ''.join(a) b = ''.join(b) if int(a) - int(b) > 0: print('YES') else: print('NO')