#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr long long MOD = 1000000007;
using Graph = vector<vector<long long>>;
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long a[N];
  map<long long, long long> m;
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  long long cou = 0;
  for (auto p : m) {
    cou++;
  }
  string ans = "Yes";
  if (cou > 3 || N % 3 != 0)
    ans = "No";
  else if (cou == 3) {
    long long x[3];
    cou = 0;
    for (auto p : m) {
      x[cou] = p.first;
      cou++;
    }
    long long w = x[0] ^ x[1] ^ x[2];
    if (w != 0) ans = "No";
  } else if (cou == 0) {
    long long x = 0;
    for (auto p : m) {
      x = p.first;
    }
    if (x != 0) ans = "No";
  } else if (cou == 2) {
    long long x, y;
    for (auto p : m) {
      x = p.first;
      y = p.second;
    }
    if (x != 0 || y != N / 3) ans = "No";
  }
  cout << ans << endl;
}
