import Foundation

var array:[Int] = readLine()!.components(separatedBy: " ").map{Int($0)!}

if((array[0] < array[2] && array[2] < array[1]) || (array[0] > array[2]) && array[2] > array[1]){
    print("Yes")
}else{
    print("No")
}
