#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
int x_pos[4] = {1, 0, -1, 0}, y_pos[4] = {0, 1, 0, -1};
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
char upper(char c) { return c - 0x20; }
char lower(char c) { return c + 0x20; }
void unique_vector(vector<int>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  sort(v.begin(), v.end());
  int a = v[0], b = v[n - 1];
  int z = 0;
  int a_cnt = 0, b_cnt = 0, ab_cnt = 0;
  for (int i = 0; i < (n); ++i) {
    if (v[i] == a) a_cnt++;
    if (v[i] == b) b_cnt++;
    if (v[i] == (a ^ b)) ab_cnt++;
    if (v[i] == 0) z++;
  }
  bool can = false;
  if (z % 3) {
    if (z == n) can = true;
  } else {
    if (z == n) can = true;
    if (a_cnt == n / 3 && b_cnt == n / 3 && ab_cnt == n / 3) can = true;
    if ((a_cnt == n * 2 / 3 || b_cnt == n * 2 / 3) && z == n / 3) can = true;
  }
  cout << (can ? "Yes" : "No") << endl;
}
