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