#include <bits/stdc++.h>
using namespace std;
long long N;
int main() {
  cin >> N;
  vector<int> f(100010);
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) {
      auto found_itr = find(a.begin(), a.end(), a[i] ^ a[j]);
      if (found_itr == a.end()) {
        cout << "NO" << endl;
        exit(1);
      }
    }
  }
  cout << "YES" << endl;
}
