V1 = raw_input() V2 = raw_input() V1 = V1.replace(".","") V2 = V2.replace(".","") if V2 <= V1: print "YES" else: print "NO"