#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;
int main() {
  int n, a, ans = 1;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a;
    mp[a]++;
  }
  if (mp.size() == 1) {
    if (mp[0] != n) ans = false;
  } else if (mp.size() == 2) {
    if (n % 3 == 0) {
      if (mp[0] != n / 3) ans = false;
    }
  } else if (mp.size() == 3) {
    int x, y, z, tmp = 0;
    auto p = mp.begin();
    x = (*p).first;
    p++;
    y = (*p).first;
    p++;
    z = (*p).first;
    tmp = x ^ y;
    tmp ^= z;
    if (tmp != 0 || mp[x] != mp[y] || mp[x] != mp[z] || mp[y] != mp[z])
      ans = false;
  } else
    ans = 0;
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
