#include #include #include #include using namespace std; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define FOR_LL( VAR , INITIAL , FINAL_PLUS_ONE ) for( ll VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) #define RETURN( ANSWER ) cout << ( ANSWER ) << endl; return 0 int main() { string A[6]; FOR_LL( i , 0 , 6 ){ cin >> A[i]; } ll num[6] = {}; ll num_lim = 1; FOR_LL( i , 1 , 6 ){ string& Ai = A[i]; bool searching = true; FOR_LL( j , 0 , i ){ if( Ai == A[j] ){ num[i] = num[j]; j = i; searching = false; } } if( searching ){ num[i] = num_lim; num_lim++; } } ll N = 1; FOR_LL( i , 0 , num_lim ){ N *= 2; } bool b[6]; FOR_LL( v , 0 , N ){ FOR_LL( i , 0 , num_lim ){ b[i] = ( v >> i ) % 2 == 1; } if( ! ( ( ! ( ( ! ( b[num[0]] && b[num[1]] ) ) && b[num[2]] ) ) && ( ! ( ( ! ( b[num[3]] && b[num[4]] ) ) && b[num[5]] ) ) ) ){ RETURN( "YES" ); } } RETURN( "NO" ); }