#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; #include #include namespace mp = boost::multiprecision; using Bint = mp::cpp_int; template vector compress(vector &X){ vector vals=X; sort(vals.begin(),vals.end()); vals.erase(unique(vals.begin(), vals.end()),vals.end()); for(int i=0;i<(int)X.size(); i++){ X[i]=lower_bound(vals.begin(),vals.end(),X[i])-vals.begin(); } return vals; } int f(int x,int y){ if(x && y) return 0; return 1; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); vector A(6); rep(i,6) cin>>A[i]; compress(A); int ma=0; rep(i,6) ma=max(ma,(int)A[i]); bool b=false; for(int bit=0;bit<(1<<(ma+1));bit++){ vector B(6); rep(i,6){ if(bit&(1<<(int)A[i])) B[i]=1; } if(f(f(f(B[0],B[1]),B[2]),f(f(B[3],B[4]),B[5]))) b=true; } if(b) cout<<"YES"<