#include #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector a(3), b(3); for (int &i: a) cin >> i; for (int &i: b) cin >> i; auto f2 = [](vector x) -> bool { return set(x.begin(), x.end()).size() == 3 && ((x[1] > x[0] && x[1] > x[2]) || (x[1] < x[0] && x[1] < x[2])); }; auto f = [&f2](vector a, vector b, int i, int j) -> bool { swap(a[i], b[j]); return f2(a) && f2(b); }; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (f(a, b, i, j)) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; return 0; }