#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t, q;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> n;
  int a[n + 1];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  int flag = 1;
  for (int i = 0; i < n; ++i) {
    if ((a[i] ^ a[(i + 2) % n]) != a[(i + 1) % n]) {
      flag = 0;
      break;
    }
  }
  if (flag == 1)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
