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_d[1]+second_d[2]) result = "" if first_int >second_int: result = "YES" else: result="NO" print(result)