a, b, c = map(int, input().split('.')) e, f, g = map(int, input().split('.')) abc = a * 1000000 + b * 1000 + c efg = e * 1000000 + f * 1000 + g if abc >= efg: print('YES') else: print('NO')