#include using namespace std; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } int main() { int a[3], b[3]; for (auto &e : a) cin >> e; for (auto &e : b) cin >> e; auto is_kadomatsu = [](int a, int b, int c) { return a != b && b != c && a != c && min({ a, b, c }) == b; }; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { swap(a[i], b[j]); if (is_kadomatsu(a[0], a[1], a[2]) && is_kadomatsu(b[0], b[1], b[2])) { cout << "Yes" << endl; return 0; } swap(a[i], b[j]); } } cout << "No" << endl; }