#include using namespace std; using ull = unsigned long long; int main(){ 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; } for(int i = 1; i < n; i++){ if(a[i] ^ a[i ^ 1] ^ a[1]){ cout << "No" << '\n'; return 0; } } cout << "Yes" << '\n'; }