function Main(input) {
  line = input.split(' ');
  a = line[0] * 1
  b = line[1] * 1
  c = line[2] * 1
  if (a < b) {
     if (a < c && c < b) {
        ans = true
     }
  } else {
     if (b < c && c < a) {
        ans = true
     }
  }
  if (ans) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
