#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; bool mmax = a[0] < a[1] && a[1] > a[2]; bool mmin = a[0] > a[1] && a[1] < a[2]; return mmin || mmax; } 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.size()), B(bi.size()); copy(ai.begin(), ai.end(), A.begin()); copy(bi.begin(), bi.end(), B.begin()); 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; }