first_s = input() first_d = first_s.split(".") first_int = int(first_d[0]+first_d[1]+first_d[2]) second_s = input() second_d = second_s.split(".") second_int = int(second_d[0]+second[1]+second[2]) result = "" if first_int >second_int: result = "YES" else: result="NO" print(result)