#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; return (a[0] < a[1] && a[1] > a[2]) || (a[0] > a[1] && a[1] < a[2]); } 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]); // Trace(A); // Trace(B); if (IsKadomatsu(A) == true && IsKadomatsu(B) == true) { cout << "Yes" << '\n'; return; } } } cout << "No" << '\n'; return; } int main() { FastIO; solve(); return 0; }