#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n;
long long a[N], ans[N];
map<long long, long long> f;
vector<long long> v;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  if (f.size() > 3) {
    cout << "No";
    exit(0);
  }
  long long answer = 0;
  vector<long long> v;
  for (auto &it : f) v.push_back(it.first);
  do {
    bool cur = 1;
    long long sz = f.size();
    for (long long i = 0; i < sz; i++) {
      long long shouldBe = n / sz;
      if (n % sz >= (i + 1)) shouldBe++;
      if (f[v[i]] < shouldBe) {
        cur = 0;
        break;
      }
    }
    for (long long j = 0; j < n; j++) ans[j] = ans[j + n] = v[j % sz];
    for (long long j = 1; j + 1 < 2 * n - 1; j++) {
      if (ans[j] != (ans[j - 1] ^ ans[j + 1])) {
        cur = 0;
        break;
      }
    }
    answer |= cur;
  } while (next_permutation(v.begin(), v.end()));
  if (answer)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
