#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; bool chk(vector a) { if (a[0] != a[1] && a[1] != a[2] && a[2] != a[0]) { if (max({ a[0], a[1], a[2] }) == a[1] || min({ a[0], a[1], a[2] }) == a[1]) { return true; } } return false; } int main() { vector a(3), b(3); rep(i, 3) cin >> a[i]; rep(i, 3) cin >> b[i]; bool ok = false; rep(i, 3) rep(j, 3) { swap(a[i], b[j]); if (chk(a) && chk(b)) ok = true; swap(a[i], b[j]); } cout << (ok ? "Yes" : "No") << endl; return 0; }