#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; vector a(1 << n); for (int i = 0; i < (1 << n); i++) { cin >> a[i]; } if (a[0]) { cout << "No" << endl; return 0; } for (int i = 0; i < (1 << n); i++) { unsigned long long tmp = 0; for (int j = 0; j < n; j++) { if (i & (1 << j)) { tmp ^= a[1 << j]; } } if (tmp != a[i]) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; }