#include <bits/stdc++.h>
using namespace std;
int nx[] = {0, 1, 0, -1};
int ny[] = {0, 1, 0, -1};
int main(void) {
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  if ((a > c && b < c) || (a < c && b > c)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
