#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  multiset<long long> s;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  long long t1 = a[0];
  s.erase(s.find(a[0]));
  long long b[n];
  b[0] = a[0];
  long long t2 = -1, t3 = -1;
  for (long long i = 1; i < n; i++) {
    t2 = a[i];
    s.erase(s.find(a[i]));
    if (s.count(t2 ^ t1)) {
      t3 = t2 ^ t1;
      s.erase(s.find(t3));
      break;
    }
    s.insert(a[i]);
  }
  if (t3 == -1) {
    cout << "No"
         << "\n";
    return 0;
  }
  b[1] = t2;
  b[2] = t3;
  long long i = 3;
  bool ans = true;
  while (!s.empty()) {
    if (!s.count((t2 ^ t3))) {
      ans = false;
      break;
    } else {
      long long t4 = (t2 ^ t3);
      t2 = t3;
      t3 = t4;
      b[i] = t4;
      i++;
      s.erase(s.find(t4));
    }
  }
  for (long long i = 0; i < n; i++) {
    if ((b[i] ^ b[(i + 2) % n]) != b[(i + 1) % n]) {
      ans = false;
    }
  }
  if (ans) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}
