#include "bits/stdc++.h" using namespace std; using LLI = long long; #define INF 999999999 #define MOD 1000000007 #define FOR(i, s, e) for(LLI i = s, i##_lim = (e); i < i##_lim; i++) #define FORR(i, s, e) for(LLI i = s-1, i##_lim = (e); i##_lim<=i; i--) #define REP(i, n) FOR(i,0,n) #define REPR(i, n) FORR(i,n,0) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define bit(a, shift) ((a>>shift)&1)) #define pm(a) ((a)?1:-1) #define SORT(v) sort(v.begin(),v.end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) #define Mat2(type,name,h,w,def) vector> name(h,vector(w, def)) #define Mat3(type,name,h,w,d,def) vector>> name(h,vector>(w, vector(d,def))) // int 2.14E±9 LLIi 9.2E±18 double 1.7E±380 int main() { cout << fixed << setprecision(10); vector v(6); REP(i, 6)cin >> v[i]; REP(i, 3) { REP(j, 3) { vector v2 = v; swap(v2[i], v2[j + 3]); if (v2[0] != v2[1] && v2[1] != v2[2] && v2[3] != v2[4] && v2[4] != v2[5] &&((max(max(v2[0], v2[1]), v2[2]) == v2[1] && max(max(v2[3], v2[4]), v2[5]) == v2[4])|| (min(min(v2[0], v2[1]), v2[2]) == v2[1] && min(min(v2[3], v2[4]), v2[5]) == v2[4]))) { cout << "Yes"; return 0; } } } cout << "No"; return 0; }