a = map(int, raw_input().split('.')) b = map(int, raw_input().split('.')) if a < b: print 'NO' else: print 'YES'