#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 61;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long jou(long long N, long long P) {
  if (P == 0) return 1;
  if (P % 2 == 0) {
    long long t = jou(N, P / 2);
    return t * t % 1000000007;
  }
  return (N * jou(N, P - 1)) % 1000000007;
}
int main() {
  long long n;
  cin >> n;
  map<long long, int> p;
  bool allz = true;
  for (int i = 0; i < (int)(n); i++) {
    long long x;
    cin >> x;
    if (p.count(x))
      p.at(x)++;
    else
      p[x] = 1;
    if (x != 0) allz = false;
  }
  if (n % 3 != 0) {
    cout << (allz ? "Yes" : "No") << endl;
  } else if (allz)
    cout << "Yes" << endl;
  else if (p.size() != 3)
    cout << "No" << endl;
  else {
    long long now = 0;
    vector<long long> q(3);
    vector<long long> r(3);
    for (auto x : p) {
      q[now] = x.first;
      r[now] = x.second;
      now++;
    }
    cout << ((q[0] ^ q[1] == q[2] && r[0] == r[1] && r[1] == r[2]) ? "Yes"
                                                                   : "No")
         << endl;
  }
}
