#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> freq;
  long long tmp;
  for (long long i = 0; i < (n); i++) cin >> tmp, freq[tmp]++;
  if (n % 3 != 0) return cout << "No", 0;
  if (freq.size() > 3) return cout << "No", 0;
  vector<long long> f;
  for (auto &p : freq) f.push_back(p.second);
  vector<long long> a;
  for (auto &p : freq) a.push_back(p.first);
  sort(f.begin(), f.end());
  bool flag = false;
  if (f.size() == 1) flag = true;
  if (f.size() == 2 && f[1] == f[0] * 2) flag = true;
  if (f.size() == 3 && f[0] == f[1] && f[1] == f[2]) flag = true;
  if (f.size() == 1 && a[0] != 0) flag = false;
  long long x = freq.begin()->second, y = freq.rbegin()->second;
  if (f.size() == 2 &&
      ((y < x ? freq.rbegin()->first : freq.begin()->first) != 0))
    flag = false;
  if (f.size() == 3 && (a[0] ^ a[1]) != a[2]) flag = false;
  cout << (flag ? "Yes" : "No");
  return 0;
}
