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

int main() {
    int a, b, c;
    cin >> a >> b >>c;

    if (a < b) {
        if (a <= c && c <= b)
            puts("Yes");
        else
            puts("No");
    }
    else {
        if (b <= c && c <= a)
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll a,b,c;
    cin>>a>>b>>c;
    if(a>b)swap(a,b);
    rep(a,i,b+1){
        if(i==c){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}
