#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
int main() {
  int n;
  long long a[100001] = {};
  long long d[100001] = {}, b[3] = {};
  cin >> n;
  if (n % 3 > 0) {
    cout << "No" << endl;
    return 0;
  }
  int t = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i + 1];
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if (a[i] != a[i + 1]) {
      b[t] = a[i + 1];
      t++;
      d[t]++;
    } else
      d[t]++;
    if (b[3] > 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((b[0] ^ b[1]) == b[2] && (b[1] ^ b[2]) == b[0] && (b[0] ^ b[2]) == b[1]) {
    if (d[1] == n / 3 && d[2] == n / 3 && d[3] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
