#include // #include // NOTE: AtCoderライブラリ #define fi first #define se second #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dbg(x) cerr << #x << ": " << x << endl; #define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl; #define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl; #define nl() cout << "========================================" << endl; using namespace std; // using namespace atcoder; // NOTE: AtCoderライブラリ typedef long long ll; typedef long double ld; typedef vector vi; typedef vector> vvi; typedef vector vl; typedef vector> vvl; typedef vector vb; typedef vector vc; typedef vector vs; typedef pair pii; typedef pair pll; const long long LINF = 1001002003004005006ll; const int INF = 1001001001; template void chmin(T &a, T b) { if (a > b) a = b; } template void chmax(T &a, T b) { if (a < b) a = b; } #define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn; bool f(vi x) { if (x[0] == x[1] || x[1] == x[2] || x[0] == x[2]) return false; int xmax = *max_element(x.begin(), x.end()); int xmin = *min_element(x.begin(), x.end()); if (x[1] == xmax || x[1] == xmin) return true; else return false; } int main() { vi A(3); rep(i, 3) cin >> A[i]; vi B(3); rep(i, 3) cin >> B[i]; rep(i, 3) { rep(j, 3) { vi A2 = A; vi B2 = B; swap(A2[i], B2[j]); bool ok = f(A2); ok = f(B2) && ok; if (ok) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; }