#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e+14;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
void Yes() {
  cout << "Yes" << endl;
  exit(0);
}
void No() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  bool ans = false;
  if (N % 3 == 0) {
    long long b = a[0];
    bool hantei = false;
    for (int i = 0; i < 50; i++) {
      long long c;
      c = b % 2;
      b /= 2;
      if (c == 0) {
        hantei = false;
        break;
      }
      if (b == 1) {
        hantei = true;
        break;
      }
    }
    if (hantei) {
      long long g = N / 3;
      long long h = N - N / 3;
      if (a[0] ^ a[g] == a[h]) {
        if (a[0] == a[g - 1]) {
          if (a[g] == a[h - 1]) {
            if (a[h] == a[N - 1]) {
              ans = true;
            }
          }
        }
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
