#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++){ for(int j = i + 1; j < n; j++){ if(a[i ^ j] != (a[i] ^ a[j])){ puts("No"); return 0; } } } puts("Yes"); }