#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (auto &i : a) cin >> i;
  sort(a.begin(), a.end());
  if (N % 3 != 0) {
    if (a[N - 1] == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  bool flag = true;
  for (int i = 0; i + 1 < N / 3; i++)
    if (a[i] != a[i + 1]) flag = false;
  for (int i = N / 3; i + 1 < N / 3 * 2; i++)
    if (a[i] != a[i + 1]) flag = false;
  for (int i = N / 3 * 2; i + 1 < N; i++)
    if (a[i] != a[i + 1]) flag = false;
  if (flag) {
    int X = a[0];
    X ^= a[N / 3];
    X ^= a[N / 3 * 2];
    if (X != 0) flag = false;
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
