list0 = input().split(".") list1 = input().split(".") ver0 = int(list0[0] + list0[1] + list0[2]) ver1 = int(list1[0] + list1[1] + list1[2]) if int(list0[0]) >= int(list1[0]) and \ int(list0[1]) >= int(list1[1]) and \ int(list0[2]) >= int(list1[2]): print("YES") else: print("NO")