#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < (n); i++) cin >> a[i], mp[a[i]]++;
  if (mp.size() >= 4) {
    cout << "No" << endl;
  }
  vector<int> v;
  for (auto e : mp) v.push_back(e.first);
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v.size(); j++) {
      int x = v[i];
      int y = v[j];
      auto mp2 = mp;
      mp2[x]--;
      mp2[y]--;
      for (int k = 0; k < (n); k++) {
        int z = x ^ y;
        x = y;
        y = z;
        mp2[y]--;
      }
      mp2[x]++;
      mp2[y]++;
      bool all = v[i] == x && v[j] == y;
      for (auto e : mp2) {
        all &= e.second == 0;
      }
      if (all) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
}
