#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0 ? a : gcd(b, a % b));
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int bexp(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = res * a % 998244353;
    }
    a = a * a % 998244353;
    b >>= 1;
  }
  return res % 998244353;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<long long int, long long int> mi;
  long long int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mi[a[i]]++;
  }
  int f = 0;
  if (mi.find(0) != mi.end() && mi[0] == n) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No\n";
    return 0;
  }
  if (mi.size() == 2) {
    long long int k1 = mi.begin()->first, l1 = mi.begin()->second,
                  k2 = mi.rbegin()->first, l2 = mi.rbegin()->second;
    if (l2 == 2 * l1 && l1 == 0)
      f = 1;
    else if (l1 == 2 * l2 && l2 == 0)
      f = 1;
  } else if (mi.size() == 3) {
    long long int b[3] = {}, i = 0;
    for (auto e : mi) {
      b[i++] = e.first;
    }
    if (((b[0] ^ b[1]) == b[2]) && (mi[b[0]] == mi[b[1]]) &&
        (mi[b[0]] == mi[b[2]]))
      f = 1;
  }
  if (f)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
