#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<LL, LL>;
using VI = vector<LL>;
using VVI = vector<VI>;
using VB = vector<bool>;
using VS = vector<string>;
using VP = vector<PII>;
const string YES = "Yes";
const string NO = "No";
void solve(LL N, vector<LL> a) {
  LL sum = 0;
  unordered_map<LL, LL> m;
  for (LL i = (0); i < (N); ++i) {
    sum += a[i];
    m[a[i]]++;
  }
  if (sum == 0) {
    cout << YES << endl;
    return;
  }
  if (LL((m).size()) == 2 && m[0] == N / 3) {
    cout << YES << endl;
    return;
  }
  if (LL((m).size()) == 3) {
    VI e;
    for (auto mm : (m)) {
      if (mm.second != N / 3) {
        cout << NO << endl;
        return;
      }
      e.push_back(mm.first);
    }
    if (e[0] ^ e[1] ^ e[2] == 0) {
      cout << YES << endl;
      return;
    }
  }
  cout << NO << endl;
}
int main() {
  LL N;
  scanf("%lld", &N);
  vector<LL> a(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, move(a));
  return 0;
}
