#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF * INF * 10;
void ye() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vi a(n);
  bool zero = true;
  set<int> se;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i]) zero = false;
    se.insert(a[i]);
  }
  if (zero) {
    ye();
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    mp[a[i]]++;
  }
  int h = n / 3;
  int g = 0;
  for (P x : mp) {
    if (n % 3 or se.size() != 3 or x.second != h) {
      no();
      return 0;
    }
    g ^= x.first;
  }
  g ? no() : ye();
}
