#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
const int maxn = 1e5 + 5;
unordered_map<int, int> cnt;
vector<int> a;
int n;
void check(int l, int r) {
  vector<int> res;
  auto cnt2 = cnt;
  res.push_back(l);
  res.push_back(l ^ r);
  res.push_back(r);
  cnt2[l]--;
  cnt2[l ^ r]--;
  cnt[r]--;
  for (int i = 2; i < n - 1; i++) {
    int t = res[i] ^ res[i - 1];
    if (!cnt2[t]) return;
    cnt2[t]--;
    res.push_back(t);
  }
  for (int i = 0; i < n; i++) {
    int a = (i == 0 ? res[n - 1] : res[i - 1]);
    int b = (i == n - 1 ? res[0] : res[i + 1]);
    if (res[i] != (a ^ b)) return;
  }
  cout << "Yes\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  int l = a[0];
  int r = -1;
  for (int i = 1; i < n; i++) {
    if (cnt[l ^ a[i]]) {
      if ((l ^ a[i]) == a[i] && cnt[a[i]] == 1) continue;
      if ((l ^ a[i]) == l && cnt[l] == 1) continue;
      r = a[i];
      break;
    }
  }
  if (r == -1) return cout << "No", 0;
  check(l, r);
  check(r, l);
  cout << "No";
}
