#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll M = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  bool flag = true;
  for (int i = 0; i < (int)(n); i++) {
    if (a[i] != 0) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  int c_0 = 0;
  set<ll> s;
  for (int i = 0; i < (int)(n); i++) {
    if (a[i] == 0) {
      c_0++;
      continue;
    }
    s.insert(a[i]);
  }
  if (c_0 == n / 3 && n % 3 == 0 && s.size() == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  vector<pair<ll, ll>> v;
  set<ll> r;
  for (int i = 0; i < (int)(n); i++) {
    if (r.count(a[i])) {
      for (int j = 0; j < (int)(v.size()); j++)
        if (v[j].first == a[i]) {
          v[j].second++;
          break;
        }
    }
    r.insert(a[i]);
    v.push_back(make_pair(a[i], 0));
    if (r.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (r.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  if ((v[0].second == v[1].second) && (v[1].second == v[2].second)) {
    if (v[0].first ^ v[1].first ^ v[2].first == 0) {
      if (v[0].second == v[1].second && v[1].second == v[2].second) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
