#include using namespace std; using ull = unsigned long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, nn; cin >> n; nn = 1 << n; vector a(nn); for(auto &e : a) cin >> e; if(a[0]){ cout << "No" << '\n'; return 0; } for(int i = 0; i < nn; i++){ for(int j = (i-1)& i; j; j=(j-1)&i){ if(a[i] ^ a[j] ^ a[i^j]){ cout << "No" << '\n'; return 0; } } } cout << "Yes" << '\n'; }