#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; bool is_kadomatsu(const vector& v){ if(v[0] == v[1] || v[0] == v[2] || v[1] == v[2]) return false; if(v[0] < v[1] && v[1] > v[2]) return true; if(v[0] > v[1] && v[1] < v[2]) return true; return false; } int main(){ vector v(3), w(3); rep(i,3) cin >> v[i]; rep(i,3) cin >> w[i]; rep(i,3){ rep(j,3){ swap(v[i], w[j]); if(is_kadomatsu(v) && is_kadomatsu(w)){ cout << "Yes" << endl; return 0; } swap(v[i], w[j]); } } cout << "No" << endl; return 0; }