#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a < c && c < b) || (b < c && c < a))
        cout << "Yes";
    else
        cout << "No";
    return 0;
}
#include <bits/stdc++.h>
using namespace std;


int main(){
  vector<int> A(3);
  cin >> A[0] >> A[1] >> A[2];
  int mid = A[2];
  sort(A.begin(), A.end());
  cout << (A[1]==mid?"Yes":"No") << endl;
  return 0;
}