#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int A = min(a,b);
  int B = max(a,b);
  for(int i=A;i<=B;i++){
    if(i == c){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
#include <bits/stdc++.h>

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (ll)n; ++i)
#define INF 10e7
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
using namespace std;

void solve(void)
{
    int a, b, c;
    cin >> a >> b >> c;
    if ((a <= c && c <= b) || (b < c && c <= a))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

int main(void)
{
    solve();
}
