#include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1000 * 100 + 5;
int a[N];
int p[N];
int FIND(int v) {
  if (p[v] == v) return v;
  p[v] = FIND(p[v]);
  return p[v];
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    p[i] = i;
  }
  sort(a + 1, a + 1 + n);
  if (n <= 10) {
    do {
      bool f = true;
      for (int i = 1; i <= n; i++) {
        if (i == n - 1) {
          int x = a[i];
          int y = a[i + 1];
          int z = a[1];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        } else if (i == n) {
          int x = a[i];
          int y = a[1];
          int z = a[2];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        } else {
          int x = a[i];
          int y = a[i + 1];
          int z = a[i + 2];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        }
      }
      if (f) {
        cout << "Yes" << endl;
        return 0;
      }
    } while (next_permutation(a + 1, a + 1 + n));
    cout << "No" << endl;
    return 0;
  }
  for (int j = 0; j <= 10; j++) {
    for (int i = 1; i <= n; i++) {
      int x = i - 3;
      if (x <= 0) x = (n - x);
      int u = FIND(i);
      int uu = FIND(x);
      p[u] = uu;
    }
  }
  map<int, int> mp;
  map<int, int> mpp;
  for (int i = 1; i <= n; i++) {
    int u = FIND(i);
    mp[u]++;
    mpp[a[i]]++;
  }
  if (mp.size() != mpp.size()) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> v1, v2;
  map<int, int>::iterator it = mp.begin(), itt = mpp.begin();
  for (; it != mp.end();) {
    pair<int, int> x = *(it);
    pair<int, int> y = *(itt);
    v1.push_back(x.second);
    v2.push_back(y.second);
    it++;
    itt++;
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  for (int i = 0; i < v1.size(); i++) {
    if (v1[i] != v2[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
