#include #define FastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; bool IsKadomatsu(vector a) { if (a[0] == a[1] || a[1] == a[2] || a[0] == a[2]) return false; int mmax = max(a[0], max(a[1], a[2])); int mmin = min(a[0], min(a[1], a[2])); return mmax == a[1] || mmin == a[1]; } void Trace(vector ai) { for (const auto a : ai) cout << a; cout << '\n'; } void solve() { vector ai(3), bi(3); for (auto &a : ai) cin >> a; for (auto &b : bi) cin >> b; for (int i = 0; i < 3; i++) { vector A = ai, B = bi; for (int j = 0; j < 3; j++) { swap(A[i], B[j]); if (IsKadomatsu(A) && IsKadomatsu(B)) { cout << "Yes" << '\n'; return; } } } cout << "No" << '\n'; return; } int main() { FastIO; solve(); return 0; }