#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
static const long long MOD = 1000000007;
static const long long LINF = (long long)(1e18 + 99);
static const int INF = 1e9 + 99;
int n, v[5], k[5];
map<int, int> m;
int main(void) {
  cin >> n;
  for (int i = (0); i < (n); i++) {
    int a;
    cin >> a;
    m[a]++;
  }
  if ((int)(m).size() > 3) {
    puts("No");
    return 0;
  }
  int i = 0;
  for (auto itr = m.begin(); itr != m.end(); itr++) {
    k[i] = itr->first;
    v[i] = itr->second;
    i++;
  }
  bool ok = false;
  if (i == 1) {
    if (k[0] == 0) ok = true;
  } else if (i == 2) {
    if (k[0] == 0) {
      swap(k[0], k[1]);
      swap(v[0], v[1]);
    }
    if (k[1] == 0 && (v[0] + v[1]) % 3 == 0 && v[0] == v[1] * 2) ok = true;
  } else {
    if (k[0] ^ k[1] == k[2] && v[0] == v[1] && v[0] == v[2]) ok = true;
  }
  if (ok)
    puts("Yes");
  else
    puts("No");
  return 0;
}
