#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max() / 100;
constexpr long long DINF = 1000000000000;
const double PI = acos(-1);
struct Tll {
  LL first, second, third;
};
struct Fll {
  LL first, second, third, fourth;
};
void YN(bool f) {
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
void yn(bool f) {
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
struct Edge {
  LL to, cost;
};
struct edge {
  LL from, to, cost;
};
vector<vector<LL>> g;
vector<edge> ed;
vector<pair<LL, LL>> pv;
map<LL, LL> ma;
set<LL> st;
vector<LL> rest;
int di[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
LL n, m, k, p, q, w, h, s, t, ans, cnt, sum, a[310000], b[310000], sub[210000];
string str;
bool f;
char c[1100][1100];
int main() {
  cin >> n;
  for (LL i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) sum++;
    ma[a[i]]++;
  }
  if (sum == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    for (auto it = ma.begin(); it != ma.end(); it++) {
      while (it->second) {
        if (it->second % (n / 3) != 0) {
          cout << "No" << endl;
          return 0;
        }
        it->second -= (n / 3);
        b[cnt] = it->first;
        cnt++;
      }
    }
    if (b[0] ^ b[1] == b[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  } else
    cout << "No" << endl;
  return 0;
}
