#include using namespace std; int main(){ int N; cin >> N; vector A(1 << N); for (int i = 0; i < (1 << N); i++){ cin >> A[i]; } bool ok = true; if (A[0] != 0){ ok = false; } for (int i = 0; i < N; i++){ for (int j = (1 << i) + 1; j < (1 << (i + 1)); j++){ if (A[j] != (A[j ^ (1 << i)] ^ A[1 << i])){ ok = false; } } } if (ok){ cout << "Yes" << endl; } else { cout << "No" << endl; } }