#include using namespace std; using ull = unsigned long long; unsigned long long xor64() { static unsigned long long x = (unsigned long long)(chrono::duration_cast( chrono::high_resolution_clock::now().time_since_epoch()).count()) * 10150724397891781847ULL; x ^= x << 7; return x ^= x >> 9; } int main(){ clock_t finish = clock() + CLOCKS_PER_SEC / 1000 * 200; ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; n = 1 << n; vector a(n); for(auto &&v : a) cin >> v; if(a[0]){ cout << "No" << '\n'; return 0; } while(clock() <= finish){ int i = xor64() % n, j = xor64() % n; if(a[i] ^ a[j] ^ a[i ^ j]){ cout << "No" << '\n'; exit(0); } } cout << "Yes" << '\n'; }