a1, b1, c1 = map(int, input().split('.')) a2, b2, c2 = map(int, input().split('.')) l1 = 1000000*a1 + 1000*b1 + c1 l2 = 1000000*a2 + 1000*b2 + c2 print(['YES', 'NO'][l1 < l2])