#pragma GCC optimize ( "O3" ) #pragma GCC optimize( "unroll-loops" ) #pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" ) #include #include #include #include using namespace std; using ull = unsigned long long; #define MAIN main #define TYPE_OF( VAR ) remove_const::type >::type #define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) #define CEXPR( LL , BOUND , VALUE ) constexpr const LL BOUND = VALUE #define CIN( LL , A ) LL A; cin >> A #define ASSERT( A , MIN , MAX ) assert( ( MIN ) <= A && A <= ( MAX ) ) #define CIN_ASSERT( A , MIN , MAX ) CIN( TYPE_OF( MAX ) , A ); ASSERT( A , MIN , MAX ) #define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( TYPE_OF( FINAL_PLUS_ONE ) VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) #define QUIT return 0 #define COUT( ANSWER ) cout << ( ANSWER ) << "\n" #define RETURN( ANSWER ) COUT( ANSWER ); QUIT int MAIN() { UNTIE; CEXPR( int , bound_N , 17 ); CIN_ASSERT( N , 0 , bound_N ); CEXPR( int , bound_i , 1 << bound_N ); int i_ulim = 1 << N; ull A[bound_i]; FOR( i , 0 , i_ulim ){ cin >> A[i]; } ull B[bound_N]; FOR( d , 0 , N ){ B[d] = A[1 << d]; } FOR( i , 0 , i_ulim ){ ull a = 0; FOR( d , 0 , N ){ ( ( i >> d ) & 1 ) == 1 ? a ^= B[d] : a; } if( a != A[i] ){ RETURN( "No" ); } } RETURN( "Yes" ); }