#include <bits/stdc++.h>
using namespace std;
static const long long maxLL = (long long)1 << 62;
const long long MOD = 1000000007, INF = 1e18;
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};
template <typename T1, typename T2>
bool pairCompare(const pair<T1, T2> &firstElof,
                 const pair<T1, T2> &secondElof) {
  return firstElof.second > secondElof.second;
}
int mapMaxValue(std::map<long long, int> m) {
  int max = 0;
  for (std::map<long long, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (max < it->second) max = it->second;
  }
  return max;
}
int main(void) {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  bool is_exist = true;
  sort(a.begin(), a.end());
  long long prev, next;
  for (int i = 0; i < n; ++i) {
    prev = i == 0 ? a[n - 1] : a[i - 1];
    next = i == n - 1 ? a[0] : a[i + 1];
    if (a[i] != (prev ^ next)) is_exist = false;
  }
  sort(a.begin(), a.end(), greater<long long>());
  for (int i = 0; i < n; ++i) {
    prev = i == 0 ? a[n - 1] : a[i - 1];
    next = i == n - 1 ? a[0] : a[i + 1];
    if (a[i] != (prev ^ next)) is_exist = false;
  }
  if (is_exist)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
