#include int main() { using namespace std; vector A(6), V(6); for(unsigned long i{}; i < 6; ++i){ cin >> A[i]; [&]{ for(unsigned long j{}; j < i; ++j)if(A[j] == A[i])return V[i] = V[j]; V[i] = *max_element(begin(V), begin(V) + i) + 1; }(); } for(auto&& a : V)--a; for(unsigned long i{}; i < 64; ++i){ transform(begin(V), end(V), begin(A), [&i](auto x){return 1UL & (i >> x);}); if((!(A[0] && A[1]) && A[2]) || (!(A[3] && A[4]) && A[5])){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }