#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int ar[MAXN];
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void no() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  bool nz = false;
  for (int i = 0; i < ar[i] and not nz; ++i)
    if (ar[i] != 0) nz = true;
  if (not nz) {
    yes();
  }
  if (n % 3 != 0) {
    no();
  }
  map<int, int> unique;
  for (int i = 0; i < n; ++i) {
    auto iter = unique.find(ar[i]);
    if (iter != unique.end()) {
      int count = iter->second + 1;
      unique.erase(iter);
      unique.emplace(ar[i], count);
    } else
      unique.emplace(ar[i], 1);
    if (unique.size() > 3) {
      break;
    }
  }
  if (unique.size() > 3 or unique.size() == 1) {
    no();
  }
  if (unique.size() == 2) {
    auto iter = unique.begin();
    int i1 = iter->first, c1 = iter->second;
    ++iter;
    int i2 = iter->first, c2 = iter->second;
    if (c1 > c2) {
      swap(c1, c2);
      swap(i1, i2);
    }
    if (c1 == n / 3 and c2 == c1 * 2) {
      if ((i1 ^ i2 ^ i2) == 0)
        yes();
      else
        no();
    } else
      no();
  } else {
    auto iter = unique.begin();
    int i1 = iter->first, c1 = iter->second;
    ++iter;
    int i2 = iter->first, c2 = iter->second;
    ++iter;
    int i3 = iter->first, c3 = iter->second;
    if (not(c1 == c2 and c1 == c3 and c1 == n / 3))
      no();
    else if (not((i1 ^ i2 ^ i3) == 0))
      no();
    else
      yes();
  }
}
