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