#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

const ld pi = 3.14159265358979;
const int mod = 1000000007;

bool f(vector<int> a){
	if(a[0] == a[1] || a[1] == a[2] || a[2] == a[0]){
		return false;
	}
	if(a[0] > a[1] && a[0] > a[2]){
		return true;
	}
	if(a[0] < a[1] && a[0] < a[2]){
		return true;
	}
 return false;
}

int main(){
	vector<int> a(3) , b(3);
	for(int i = 0; i < 3; i++){
		cin >> a[i];
	}

	for(int i = 0; i < 3; i++){
		cin >> b[i];
	}

	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 3; j++){
			swap(a[i] , b[j]);
			if(f(a) && f(b)){
				cout << "Yes" << endl;
				exit(0);
			}
			swap(a[i] , b[j]);
		}
	}
	cout << "No" << endl;
	return 0;
}