#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF32 = 1e9 + 1e2;
template <typename T>
istream &operator>>(istream &a, vector<T> &v) {
  for (auto &first : v) a >> first;
  return a;
}
void stndrtn() {}
const bool flag = 0;
void maincode() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> cnt;
  for (int &first : a) cin >> first, cnt[first]++;
  vector<int> ans;
  ans = {a[0]};
  cnt[a[0]]--;
  for (int i = 1; i < n; ++i) {
    cnt[a[i]]--;
    if (cnt[a[0] ^ a[i]]) ans.push_back(a[i]), ans.push_back(a[0] ^ a[i]);
    cnt[a[i]]++;
    if ((int)ans.size() > 1) break;
  }
  if ((int)ans.size() == 1) cout << "No", exit(0);
  for (int i = 3; i < n; ++i) {
    if (!cnt[ans[i - 1] ^ ans[i - 2]]) cout << "No", exit(0);
    cnt[ans[i - 1] ^ ans[i - 2]]--;
    ans.push_back(ans[i - 1] ^ ans[i - 2]);
  }
  if ((ans[1] ^ ans[n - 1]) != a[0] || (ans[n - 2] ^ ans[0]) != ans[n - 1])
    cout << "No", exit(0);
  cout << "Yes";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr), stndrtn();
  int ts = 1;
  if (flag) cin >> ts;
  while (ts--) maincode();
  return 0;
}
