#include <bits/stdc++.h>
using namespace std;
const long long INFL = 1LL << 60;
const int INF = 1 << 30;
const long long MOD = 1e9 + 7;
vector<long long> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<long long> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long pow_long(long long x, long long k) {
  long long res = 1;
  while (k > 0) {
    if (k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
long long pow_mod(long long x, long long k) {
  x %= MOD;
  x += MOD;
  x %= MOD;
  long long res = 1;
  while (k > 0) {
    if (k % 2) {
      res *= x;
      res %= MOD;
    }
    x *= x;
    x %= MOD;
    k /= 2;
  }
  return res;
}
long long inverse(long long x) { return pow_mod(x, MOD - 2); };
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; };
int main(void) {
  long long N;
  cin >> N;
  vector<long long> A(N);
  bool all0 = 1;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    if (A[i] != 0) all0 = 0;
  }
  if (all0) {
    cout << "Yes" << endl;
    return 0;
  }
  vector<long long> cnt(40, 0);
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < 40; j++) {
      if ((A[i] >> j) & 1) cnt[j]++;
    }
  }
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  for (long long i = 0; i < 40; i++) {
    if (cnt[i] != 0 && cnt[i] % 3 != 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
