// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input int a[3], b[3]; rep(i, 3) cin >> a[i]; rep(i, 3) cin >> b[i]; // Judge bool ok = false; rep(i, 3) rep(j, 3) { swap(a[i], b[j]); bool a0 = (a[0] != a[1] && a[1] != a[2] && a[2] != a[0]); bool a1 = (a[1] == min({a[0], a[1], a[2]})); bool a2 = (a[1] == max({a[0], a[1], a[2]})); bool b0 = (b[0] != b[1] && b[1] != b[2] && b[2] != b[0]); bool b1 = (b[1] == min({b[0], b[1], b[2]})); bool b2 = (b[1] == max({b[0], b[1], b[2]})); if ((a0 && (a1 || a2)) && (b0 && (b1 || b2))) ok = true; swap(a[i], b[j]); } // Output cout << (ok ? "Yes" : "No") << endl; }