#pragma GCC optimize ("O3","unroll-loops") #pragma GCC target("avx512f") #include using namespace std; using ull = unsigned long long; int main(){ int n; cin >> n; n = 1 << n; vector a(n); for(auto &&v : a) scanf("%llu", &v); if(a[0]){ puts("No"); return 0; } for(int i = 0; i < n; i++){ register ull b = a[i]; for(int j = 0; j < i; j++){ if(b ^ a[i ^ j] ^ a[j]){ puts("No"); return 0; } } } puts("Yes"); }