#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int a[3], b[3], a1[3], b1[3]; cin >> a1[0] >> a1[1] >> a1[2] >> b1[0] >> b1[1] >> b1[2]; for (int i = 0; i < 3; i++) { a[0] = a1[0], b[0] = b1[0]; a[1] = a1[1], b[1] = b1[1]; a[2] = a1[2], b[2] = b1[2]; for (int j = 0; j < 3; j++) { swap(a[i], b[j]); if (a[0] != a[1] && a[0] != a[2] && a[1] != a[2]) { if (b[0] != b[1] && b[0] != b[2] && b[1] != b[2]) { if (max({ a[0],a[1],a[2] }) == a[1] || min({ a[0],a[1],a[2] }) == a[1]) { if (max({ b[0],b[1],b[2] }) == b[1] || min({ b[0],b[1],b[2] }) == b[1]) { cout << "Yes" << endl; return 0; } } } } } } cout << "No" << endl; }