#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int d[N];
  int a, b;
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  for (int i = 0; i < N - 1; i++) {
    a = d[i];
    b = d[i + 1];
    a = a ^ b;
    d[i + 1] = a;
  }
  if (a == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
