#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      odd, even;
  for (auto ele : v) {
    if (ele & 1)
      odd.push(ele);
    else
      even.push(ele);
  }
  long long int idx = 0;
  while (!odd.empty() && !even.empty()) {
    if (odd.size() && even.size() && odd.top() < even.top()) {
      v[idx++] = odd.top();
      odd.pop();
      v[idx++] = even.top();
      even.pop();
    } else if (odd.size() && even.size() && odd.top() < even.top()) {
      v[idx++] = even.top();
      even.pop();
      v[idx++] = odd.top();
      odd.pop();
    } else if (odd.size()) {
      v[idx++] = odd.top();
      odd.pop();
    } else {
      v[idx++] = even.top();
      even.pop();
    }
  }
  for (long long int i = 0; i < n; i++) {
    long long int val1 = v[(i + 1) % n];
    long long int val2 = v[(i - 1 + n) % n];
    if (v[i] != (val1 ^ val2)) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
