#include <bits/stdc++.h>
using namespace std;
const int max_n = 100011, inf = 1000111222;
const long long inff = 1000111222333444;
int n, a[max_n], c[max_n];
map<int, int> mp;
map<int, vector<int> > mp1;
bool check(int st) {
  mp.clear();
  for (int i = 0; i < n; ++i) {
    ++mp[a[i]];
  }
  c[0] = st;
  int x = 1;
  for (int i = 0; i < n; ++i) {
    c[(x + 1) % n] = c[(x - 1 + n) % n] ^ (x + 1);
    --mp[c[(x + 1) % n]];
    x = (x + 2) % n;
  }
  if (c[0] != st) return false;
  for (auto a : mp) {
    if (a.second != 0) return false;
  }
  return true;
}
int main() {
  cin >> n;
  int gg = n + 1;
  while (gg % 2 == 0) gg /= 2;
  if (gg != 1) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    ++mp[a[i]];
  }
  for (auto a : mp) {
    mp1[a.second].push_back(a.first);
  }
  if ((--mp1.end())->second.size() > 3) {
    cout << "No\n";
    return 0;
  }
  for (int k : (--mp1.end())->second) {
    if (check(k)) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
  return 0;
}
