#include #include using namespace std; int a[3], b[3]; bool check(int a[]) { if (a[0] == a[1] || a[1] == a[2] || a[2] == a[0]) return false; if (a[2] > a[0] && a[2] > a[1]) return true; if (a[2] < a[0] && a[2] < a[1]) return true; return false; } int main() { cin >> a[0] >> a[1] >> a[2]; cin >> b[0] >> b[1] >> b[2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { swap(a[i], b[j]); if (check(a) && check(b)) { cout << "Yes" << endl; return 0; } swap(a[i], b[j]); } } cout << "No" << endl; return 0; }