#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
  for (size_t i = 0; i <= n; i++) {
    pr[i] = i;
  }
}
int parent(int x) {
  if (x == pr[x]) return x;
  return pr[x] = parent(pr[x]);
}
bool unit(int x, int y) {
  int px = parent(x);
  int py = parent(y);
  if (px == py) return false;
  if (px < py) {
    pr[py] = px;
  } else {
    pr[px] = py;
  }
  return true;
}
long long memo[100010];
int a[100010];
int n, m;
long long calc(int x) {
  if (a[x] == 1) return 0;
  if (x > n) return 0;
  if (x == n) return 1;
  long long& res = memo[x];
  if (~res) return res;
  res = 0;
  res += calc(x + 1);
  res %= INF;
  res += calc(x + 2);
  res %= INF;
  return res;
}
int buttle(long long a, long long b, long long aa, long long bb) {
  long long ab = max(1LL, a / bb);
  long long aab = max(1LL, aa / b);
  if (ab == aab) {
    long long ar = a - ab * bb;
    long long aar = aa - aab * b;
    if (ar > 0 && aar > 0) return 0;
    if (ar <= 0 && aar <= 0) return 0;
    if (ar <= 0) return -1;
    if (aar <= 0) return 1;
  }
  if (ab > aab) {
    return 1;
  } else if (ab < aab)
    return -1;
  else
    return 0;
}
void solv() {
  int n;
  cin >> n;
  long long a[100010];
  long long kind = 0;
  map<long long, int> mp;
  bool inzero = false;
  for (size_t i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (mp[a[i]] == 1) {
      kind++;
    }
    if (a[i] == 0) {
      inzero = true;
    }
  }
  if (n % 3 != 0 || kind > 3) {
    cout << "No" << endl;
    return;
  }
  if (!inzero) {
    int c = -1;
    int t = 0;
    for (auto v : mp) {
      if (c == -1)
        c = v.second;
      else if (c != v.second) {
        cout << "No" << endl;
        return;
      }
      t ^= v.first;
    }
    if (t == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (kind > 2) {
      cout << "No" << endl;
      return;
    }
    int zc = 0;
    int oc = 0;
    for (auto v : mp) {
      if (v.first == 0)
        zc = v.second;
      else
        oc = v.second;
    }
    if (zc * 2 == oc) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
int main() {
  solv();
  return 0;
}
