#include <bits/stdc++.h>
using namespace std;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);
uniform_int_distribution<> DD(0, (1ll << 31));
long long random2() {
  return (long long(DD(eng)) * (1ll << 31) + long long(DD(eng))) &
         ((1ll << 62ll) - 1);
}
long long n, m, T, k, q;
const long long big = 1000000007;
const long long big2 = 1000000009;
const long long mod = 998244353;
const long long MAXN = 200001;
vector<long long> A;
vector<long long> dist;
map<long long, long long> M;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b, c, d;
  cin >> n;
  for (int c1 = 0; c1 < (n); ++c1) {
    cin >> a;
    A.push_back(a);
    if (M.find(a) == M.end()) {
      M[a] = 0;
      dist.push_back(a);
    }
    M[a]++;
  }
  if ((int)(dist).size() == 1 && dist[0] == 0) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 != 0 || (int)(dist).size() != 3) {
    cout << "No\n";
    return 0;
  }
  if (M[dist[0]] != n / 3 || M[dist[1]] != n / 3 || M[dist[2]] != n / 3) {
    cout << "No\n";
    return 0;
  }
  a = 0;
  if ((dist[0] ^ dist[1]) == dist[2]) a++;
  if ((dist[0] ^ dist[2]) == dist[1]) a++;
  if ((dist[2] ^ dist[1]) == dist[0]) a++;
  if (a == 3) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
