n = io.read("*n") a, b, c = io.read("*n", "*n", "*n") if a == c then print("No") elseif a < c then print(b < a and "No" or "Yes") else print(a < b and "No" or "Yes") end