#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<ll> a(N);
  ll tmp = 0;
  for (int(i) = (0); (i) < (int)(N); ++(i)) {
    cin >> a[i];
    tmp ^= a[i];
  }
  vector<ll> b(N, 0);
  for (int(i) = (0); (i) < (int)(N); ++(i)) {
    b[i] = tmp ^ a[i];
  }
  bool ok = true;
  for (int(i) = (0); (i) < (int)(N); ++(i)) {
    if (b[i] != a[i]) {
      ok = false;
    }
  }
  cout << (ok ? "YES" : "NO") << endl;
}
