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