main = do
  line <- getLine
  let
    [a,b,c] = map read $ words line :: [Int]
    func a b c 
      | a < c && c < b = "Yes"
      | a > c && c > b = "Yes"
      | otherwise = "No"
    in
      putStrLn $ func a b c

