#include using namespace std; #ifdef DEBUG_ #include #else #define dump(...) #endif #define FastIO cin.tie(nullptr), ios_base::sync_with_stdio(false); #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define output(msg) cout << (msg) << '\n' #define die(msg) \ do { \ cout << msg << endl; \ exit(0); \ } while (0) #define all(k) k.begin(), k.end() #define rall(k) k.rbegin(), k.rend() #define INFi 1 << 30 #define INFll 1LL << 60 template bool chmax(T& a, const T& b) { return ((a < b) ? (a = b, true) : (false)); } template bool chmin(T& a, const T& b) { return ((a > b) ? (a = b, true) : false); } using llint = long long int; bool is_kadomatsu(vector ai, vector bi, int a, int b) { int tmp = ai[a]; ai[a] = bi[b]; bi[b] = tmp; if (ai[1] < ai[0] && ai[0] < ai[2]) return true; if (ai[1] < ai[2] && ai[2] < ai[0]) return true; if (ai[1] > ai[0] && ai[0] > ai[2]) return true; if (ai[1] > ai[2] && ai[2] > ai[0]) return true; return false; } int main() { FastIO; vector ai(3), bi(3); rep(i, 3) cin >> ai[i]; rep(i, 3) cin >> bi[i]; bool can_kadomatsu{false}; rep(i, 3) { rep(j, 3) { if (is_kadomatsu(ai, bi, i, j)) { can_kadomatsu = true; } } } if (can_kadomatsu) output("Yes"); else output("No"); }