#include using namespace std; #define int long long signed main(){ int N,A,B,C; cin>>N>>A>>B>>C; if(min(A,C) < B && B <= max(A,C)) cout<<"Yes"<