#include <bits/stdc++.h>
using namespace std;
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(long long &x, long long y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(long long &x, long long y) { return (y > x) ? x = y, 1 : 0; }
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int mod = (int)1e9 + 7;
const int mod1 = (int)1e9 + 9;
const int mod2 = 998244353;
const long double eps = 1e-12;
const double pi = atan2(0, -1);
const int ABC = 26;
long long fac[100007];
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long modInverse(long long n) { return power(n, mod - 2); }
long long nCrModPFermat(long long n, long long r) {
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r]) % mod * modInverse(fac[n - r]) % mod) %
         mod;
}
long long binarySearch(vector<long long> arr, long long l, long long r,
                       long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
long long findPos(vector<long long> arr, long long key) {
  long long l = 0, h = 1;
  long long val = arr[0];
  while (val < key) {
    l = h;
    h = 2 * h;
    val = arr[h];
  }
  return binarySearch(arr, l, h, key);
}
long long gcd(long long a, long long b) {
  while (a % b != 0 && b % a != 0) {
    if (a > b) {
      a %= b;
    } else {
      b %= a;
    }
  }
  return (a > b) ? b : a;
}
int main() {
  int n;
  cin >> n;
  long long a[n];
  int i;
  int flag = 0;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    if (a[i] != 0) {
      flag = 1;
    }
  }
  if (flag == 0) {
    cout << "Yes";
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  sort(a, a + n);
  int count;
  vector<long long> val;
  for (int i = (0); i < (n); i++) {
    count = 1;
    while (a[i] == a[i + 1]) {
      count++;
      i++;
    }
    if (count != n / 3) {
      cout << "No";
      return 0;
    } else {
      val.push_back(a[i]);
    }
  }
  if ((val[0] ^ val[2]) != val[1]) {
    cout << "No";
  } else {
    cout << "Yes";
  }
  return 0;
}
