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