fossil = map(int, raw_input().split(".")) target = map(int, raw_input().split(".")) if fossil >= target: print "YES" else: print "NO"