#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;
const int32 INF = 1e9;
const int32 MOD = 1e9 + 7;
const int64 LLINF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n;
  cin >> n;
  vector<int32> a(n);
  set<int32> aset;
  for (int64 i = 0; i < (n); ++i) {
    cin >> a[i];
    if (i == 0) continue;
    aset.insert(a[i]);
  }
  if (n % 3 != 0) {
    cout << ((false) ? "Yes\n" : "No\n");
    return 0;
  }
  for (auto iter = aset.begin(); iter != aset.end(); ++iter) {
    int32 prev = a[0];
    int32 cur = *iter;
    int32 next;
    unordered_map<int32, int32> amap;
    for (int64 j = 0; j < (n); ++j) amap[a[j]]++;
    amap[a[0]]--;
    amap[*iter]--;
    bool found = true;
    for (int64 j = (2); j < (n); j++) {
      next = prev ^ cur;
      if (amap[next] > 0) {
        amap[next]--;
      } else {
        found = false;
        break;
      }
      prev = cur;
      cur = next;
    }
    if (found) {
      if (a[0] ^ prev == cur) {
        cout << ((true) ? "Yes\n" : "No\n");
        return 0;
      }
    }
  }
  cout << ((false) ? "Yes\n" : "No\n");
  return 0;
}
