#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
  ll n;
  cin >> n;
  vector<ll> p(n);
  for (register int i = (0), iend = (n - 1); i <= iend; ++i) {
    cin >> p[i];
  }
  vector<ll> q(n);
  q[0] = p[0];
  q[1] = p[1];
  for (register int i = (2), iend = (n - 1); i <= iend; ++i) {
    q[i] = q[(i - 2) % n] xor q[(i - 1) % n];
  }
  sort(p.begin(), p.end());
  sort(q.begin(), q.end());
  for (register int i = (0), iend = (n - 1); i <= iend; ++i) {
    if (q[i] != p[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
