#include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); vector a(3),b(3); for(int i=0;i<3;i++){ cin >> a[i]; } for(int i=0;i<3;i++){ cin >> b[i]; } auto check=[](vector a)->bool{ if(a[0]==a[1] or a[1]==a[2] or a[0]==a[2])return false; if(max({a[0],a[1],a[2]})==a[1] or min({a[0],a[1],a[2]})==a[1])return true; else return false; }; bool ok=false; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ swap(a[i],b[j]); if(check(a) and check(b))ok=true; swap(a[i],b[j]); } } if(ok)printf("Yes\n"); else printf("No\n"); }