#include <bits/stdc++.h>
using namespace std;
long long v[100004], i, j;
long long n, a, b, nr, fr[100004], maxx;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
  }
  v[0] = v[n];
  for (i = 1; i <= n; i++) {
    nr = (v[i] ^ v[i - 1]);
    if (nr > n || nr == 0) {
      cout << "No";
      return 0;
    }
    fr[nr]++;
    if (nr > maxx) maxx = nr;
    if (fr[nr] > 1) {
      cout << "No";
      return 0;
    }
  }
  if (maxx != n) {
    cout << "No";
    return 0;
  }
  cout << "Yes";
  return 0;
}
