#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = long long(1e9) + 7;
constexpr int IINF = INT_MAX;
constexpr long long LLINF = LLONG_MAX;
constexpr int MAX_N = int(1e5) + 5;
constexpr double EPS = 1e-9;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
int main() {
  int n;
  map<int, int> cnt;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    cnt[a]++;
  }
  bool ok = true;
  if (cnt.size() > 3) ok = false;
  if (cnt.size() > 1) {
    if (n % 3 != 0) ok = false;
    int a, b;
    for (auto p : cnt) {
      for (auto q : cnt) {
        if (cnt.count(p.first ^ q.first) && p.first != q.first) {
          a = p.first;
          b = q.first;
          break;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      int c = a ^ b;
      cnt[c]--;
      if (cnt[c] < 0) {
        ok = false;
      }
      a = b;
      b = c;
    }
  } else {
    if (cnt.begin()->first != 0) ok = false;
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
