#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
vector<long long> types;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long n;
  cin >> n;
  bool nonzero = false;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x) nonzero = true;
    mp[x]++;
  }
  if (!nonzero) {
    cout << "Yes";
    exit(0);
  }
  if (n % 3 != 0) {
    cout << "No";
    exit(0);
  }
  if (mp.size() > 4) {
    cout << "No";
    exit(0);
  }
  if (mp.size() == 4 && !mp.count(0)) {
    cout << "No";
    exit(0);
  }
  for (auto x : mp) {
    types.push_back(x.first);
  }
  if (mp[types[0]] == mp[types[1]] && mp[types[1]] == mp[types[2]]) {
    if ((types[0] ^ types[1]) == types[2])
      cout << "Yes";
    else
      cout << "No";
    exit(0);
  }
  return 0;
}
