//#pragma GCC target("avx") //#pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") #define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #pragma region library #include using boost::irange; #pragma region Macros #define EXPAND(x) x #define _overload4(_1, _2, _3, _4, name, ...) name #define rep1(i, n) for (decltype(n) i = 0; i < (n); ++i) #define rep2(i, a, b) for (decltype(b) i = static_cast(a); i < (b); ++i) #define rep3(i, a, b, c) for (decltype(b) i = static_cast(a); i < (b); i += static_cast(c)) #define rept(...) EXPAND(_overload4(__VA_ARGS__, rep3, rep2, rep1, )(__VA_ARGS__)) #define per1(i, n) for (decltype(n) i = (n); i >= 0; --i) #define per2(i, a, b) for (decltype(a) i = (a); i >= static_cast(b); --i) #define per3(i, a, b, c) for (decltype(a) i = (a); i >= static_cast(b); i -= static_cast(c)) #define pert(...) EXPAND(_overload4(__VA_ARGS__, per3, per2, per1, )(__VA_ARGS__)) #define itrall(x) std::begin(x), std::end(x) using i16 = short; using i32 = int; using i64 = long long; #pragma endregion #ifndef CnM_library #define debug(x) constexpr int dx[] = { 1, 0, -1, 0 }; constexpr int dy[] = { 0, 1, 0, -1 }; template static constexpr T INF = std::numeric_limits::max() / 2; constexpr int mod = 1000000007; constexpr int mod2 = 998244353; #define elif else if #define len(T) (int)(T).size() template inline bool ckmax(T& A, const U& B) { return B > A ? A = B, true : false; } template inline bool ckmin(T& A, const U& B) { return B < A ? A = B, true : false; } struct setup_fixed { setup_fixed() { std::cout << std::fixed << std::setprecision(15); } } setup_fixed_; namespace lib { template inline T Pow(T A, U B) { T res(1); while (B) { if (B & 1) res *= A; A *= A; B >>= 1; } return res; } inline long long gcd(long long A, long long B) { while (B) { const long long C = A; A = B; B = C % B; } return A; } inline long long lcm(const long long A, const long long B) { return A / gcd(A, B) * B; } inline long long extgcd(long long A, long long B, long long& X, long long& Y) { long long D = A; if (B != 0) { D = extgcd(B, A % B, Y, X); Y -= (A / B) * X; return D; } else { X = 1; Y = 0; return A; } } inline long long modpow(long long A, long long B, const long long MOD) { long long res(1); while (B) { if (B & 1) res *= A, res %= MOD; A *= A; A %= MOD; B >>= 1; } return res; } template inline T inverse(T A, const T M) { T B = M, U = 1, V = 0; while (B) { T t = A / B; A -= t * B; std::swap(A, B); U -= t * V; std::swap(U, V); } U %= M; return U < 0 ? U += M, U : U; } } template inline void read(T& Tar) { std::cin >> Tar; return; } template inline void read(T& Tar, Ts&... ts) { std::cin >> Tar; read(ts...); return; } template inline void print(T Tar) { std::cout << Tar; return; } template inline void print(T Tar, Ts... ts) { std::cout << Tar; print(ts...); return; } #endif #pragma endregion struct Long_Mantion { int N; std::vector C; std::vector> keys; std::vector Memo, o_1, o_2; std::vector> range_ans; Long_Mantion() { // input read(N); C.resize(N - 1); rept(i, N - 1) read(C[i]); keys.resize(N); rept(i, N) { int B; read(B); keys[i].resize(B); rept(j, B) { int X; read(X); X--; keys[i][j] = X; } } // 端を出す Memo.resize(N, -1); o_1.resize(N); o_2.resize(N); rept(i, N - 1) { for (auto& key : keys[i]) ckmax(Memo[key], i); o_1[i] = Memo[C[i]]; } std::fill(itrall(Memo), N + 1); pert(i, N - 2, 0) { for (auto& key : keys[i + 1]) ckmin(Memo[key], i); o_2[i] = Memo[C[i]]; } } std::pair range_solve(int v) { // ここできない } void solve() { int Q; read(Q); range_ans.resize(N, std::make_pair(-1, -1)); rept(i, N) range_solve(i); rept(i, Q) { int x, y; read(x, y); x--; auto check = [&](int x, int y)->bool { std::pair C = range_ans[x]; return (C.first <= y && C.second >= y); }; print((check(x, y)) ? "Yes\n" : "No\n"); } } }; //ゆきこするぜ struct TaskA { void solve() { int A[3], B[3]; rept(i, 3) read(A[i]); rept(i, 3) read(B[i]); rept(i, 3) rept(j, 3) { std::swap(A[i], B[j]); if (A[0] != A[1] && A[1] != A[2] && A[0] != A[2] && B[0] != B[1] && B[1] != B[2] && B[2] != B[3] && A[1] > A[0] && A[1] > A[2] && B[1] > B[0] && B[1] > B[2]) { print("Yes\n"); return; } std::swap(A[i], B[j]); } print("No\n"); } }; int main(void) { TaskA solver; solver.solve(); return 0; }