#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

const string YES = "Yes";
const string NO = "No";

void solve(ll A, ll B, ll C) {
  bool pred = (A-C) * (C-B) > 0;
  cout << (pred ? YES : NO) << endl;
}

int main() {
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  ll C;
  cin >> C;
  solve(A, B, C);
  return 0;
}

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


int main() {

    int a,b,c;
    cin>>a>>b>>c;


    if(c>=a&&c<=b||c>=b&&c<=a)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}