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