#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++) { for (int j = 0; j < 3; j++) { swap(ai[i], bi[j]); if (IsKadomatsu(ai) && IsKadomatsu(bi)) { cout << "Yes" << '\n'; return; } swap(ai[i], bi[j]); } } cout << "No" << '\n'; return; } int main() { FastIO; solve(); return 0; }