#include <bits/stdc++.h>
using namespace std;
void print(bool c) { (c) ? (cout << "Yes" << endl) : (cout << "No" << endl); }
void Print(bool c) { (c) ? (cout << "YES" << endl) : (cout << "NO" << endl); }
template <typename T>
T gcd(T a, T b) {
  while (1) {
    if (a < b) swap(a, b);
    if (b == 0) break;
    a %= b;
  }
  return a;
}
template <typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second != b.second) return a.second < b.second;
  return a.first < b.first;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int eve(int x) {
  if (x % 400 == 0) return 1;
  if (x % 100 == 0) return 0;
  if (x % 4 == 0) return 1;
  return 0;
}
int main(void) {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  long long int zero = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (!a[i]) zero++;
  }
  if (zero == n) return print(1), 0;
  if (n % 3 != 0) return print(0), 0;
  sort(a.begin(), a.end());
  if (a[0] == a[n / 3 - 1] && a[n / 3] == a[n - 1]) return print(1), 0;
  if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] &&
      a[2 * n / 3] == a[n - 1] && a[0] ^ a[n / 3] ^ a[2 * n / 3] == 0)
    return print(1), 0;
  print(0);
}
