#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
int a[N];
map<int, int> mp;
vector<int> v;
bool stg() {
  for (int i = 1; i <= n; ++i) {
    mp[a[i]]++;
  }
  if (mp.size() > 3) {
    return false;
  }
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); ++it)
    v.push_back(it->first);
  int j = 0;
  for (int i = 1; i <= n; ++i) {
    ++j;
    while (mp[v[j % v.size()]] == 0) {
      ++j;
    }
    a[i] = v[j % v.size()];
    mp[a[i]]--;
  }
  for (int i = 1; i <= n; ++i) {
    if (i == 1) {
      if ((a[n] ^ a[i + 1]) != a[i]) return false;
    } else if (i == n) {
      if ((a[1] ^ a[i - 1]) != a[i]) return false;
    } else {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) return false;
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  if (stg())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
