#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int inf_int = 1e9 + 100;
const long long inf_ll = 1e18;
const double pi = 3.1415926535898;
bool debug = 0;
const int MAXN = 4100 + 100;
const int LOG = 22;
const int mod = 1e9 + 7;
const int MX = 1e6 + 100;
const long long MOD = 1000000000949747713ll;
void solve() {
  int n;
  cin >> n;
  map<int, int> mp;
  int last = -1;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    last = x;
    mp[x]++;
  }
  if (mp.count(0) == 1 && mp[0] == n) {
    cout << "Yes";
    return;
  }
  if ((int(mp.size())) != 3) {
    cout << "No";
    return;
  }
  int val = mp[last];
  vector<int> v;
  for (auto x : mp) {
    if (x.second != val) {
      cout << "No";
      return;
    }
    v.push_back(x.first);
  }
  sort(v.begin(), v.end());
  for (int val : v) {
    if (debug) cout << val << " ";
  }
  if (debug) cout << endl;
  do {
    bool flag = true;
    for (int i = 0; i < 3; ++i) {
      if ((v[i] ^ v[(i + 2) % 3]) != (v[(i + 1) % 3])) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "Yes";
      return;
    }
  } while (next_permutation(v.begin(), v.end()));
  cout << "No";
  return;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  int t = 1;
  while (t--) solve();
  if (debug)
    cerr << endl << "time : " << (1.0 * clock() / CLOCKS_PER_SEC) << endl;
}
