// 誤解法(愚直O(N^2)解)チェック #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]; } if( A[0] != 0 ){ RETURN( "No" ); } FOR( i , 0 , i_ulim ){ ull& Ai = A[i]; FOR( j , i + 1 , i_ulim ){ if( A[i^j] != ( Ai ^ A[j] ) ){ RETURN( "No" ); } } } RETURN( "Yes" ); }