function main(input) {
  var sp = input.split(" ")
  for (var i = 0; i < sp.length; i++) {
    sp[i] = parseInt(sp[i])
  }
  const [a, b, c] = sp
  const check1 = a < c && c < b
  const check2 = a > c && c > b

  const r = (check1 || check2) ? 'Yes' : "No"
  console.log(r);
}
