#include using namespace std; int main(){ long long a,b,c,d;cin>>a>>b>>c>>d; if((b < c && c < d) || (b > c && c > d))cout << "Yes" << endl; else cout << "No" << endl; }