#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
long long factorial(long long n) {
  long long t = 1;
  for (long long(i) = 1; (i) <= (n); ++(i)) t *= i;
  return t;
}
long long combinations(long long n, long long k) {
  long long r = 1;
  for (long long d = 1; d <= k; ++d) {
    r *= n--;
    r /= d;
  }
  return r;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> m;
  bool z = false, az = true, f = false;
  for (long long(i) = 0; (i) < (n); ++(i)) {
    cin >> a[i];
    ++m[a[i]];
    if (a[i] != 0)
      az = false;
    else
      z = true;
  }
  if (az) cout << ("Yes") << endl;
  ;
  if (n % 3 == 0) {
    long long num = n / 3;
    if (z) {
      long long x = -1;
      for (long long(i) = 0; (i) < (n); ++(i)) {
        if (a[i] != 0) {
          x = a[i];
        }
      }
      if (m[x] == num * 2 && m[0] == num) {
        f = true;
      }
    } else {
      for (long long(i) = 1; (i) <= (n - 1); ++(i)) {
        if (a[i] != a[0]) {
          long long x = a[0], y = a[i], z = x ^ y;
          if (m.count(z)) {
            if (m[x] == num && m[y] == num && m[z] == num) {
              f = true;
            }
          }
        }
      }
    }
  }
  if (f)
    cout << ("Yes") << endl;
  else
    cout << ("No") << endl;
  return 0;
}
