#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
const long long INF = 100000000000000000;
const long long INF2 = 9223372036854775807;
const long long MOD = 1000000007;
long long ceil2(long long a, long long b) {
  if (a % b == 0) {
    return a / b;
  } else {
    return a / b + 1;
  }
}
long long pow2(long long a, long long b) {
  long long r = 1;
  for (long long i = 1; i <= b; i++) {
    r *= a;
  }
  return r;
}
long long Log2(long long a) {
  long long t = 0;
  while (1) {
    if (a == 0 || a == 1) {
      break;
    }
    a /= 2;
    t++;
  }
  return t;
}
long long N;
long long A[100010];
set<long long> U;
map<long long, long long> H;
long long C[5];
signed main() {
  cin >> N;
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> A[i];
    U.insert(A[i]);
    H[A[i]]++;
  }
  sort(A, A + N);
  vector<long long> v;
  for (auto x : U) {
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  if (U.size() == 1) {
    cout << "Yes" << endl;
  } else if (U.size() == 2) {
    long long A = v[0], B = v[1];
    for (long long i = 0; i < (long long)(N); i++) {
      if (i % 3 == 0)
        C[0]++;
      else if (i % 3 == 1)
        C[1]++;
      else
        C[2]++;
    }
    if (C[0] == H[A] && C[1] == H[B] && C[2] == H[A ^ B]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (U.size() == 3) {
    if ((v[0] ^ v[1]) != v[2]) {
      cout << "No" << endl;
      return 0;
    }
    long long A = v[0], B = v[1];
    for (long long i = 0; i < (long long)(N); i++) {
      if (i % 3 == 0)
        C[0]++;
      else if (i % 3 == 1)
        C[1]++;
      else
        C[2]++;
    }
    if (C[0] == H[A] && C[1] == H[B] && C[2] == H[A ^ B]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
