#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a.begin(), a.end());
  int num0 = 0;
  int numM = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] == 0)
      num0++;
    else if (a[i] == a[N - 1])
      numM++;
  }
  if (num0 == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 > 0) {
    cout << "No" << endl;
    return 0;
  }
  if (N / 3 == num0 && 2 * N / 3 == numM) {
    cout << "Yes" << endl;
    return 0;
  }
  vector<int> c(N);
  copy(a.begin(), a.end(), c.begin());
  c.erase(unique(c.begin(), c.end()), c.end());
  if (c.size() == 3 && c[0] ^ c[1] ^ c[2] == 0) {
    int c1 = 0, c2 = 0, c3 = 0;
    for (int i = 0; i < N; i++) {
      if (c[0] == a[i])
        c1++;
      else if (c[1] == a[i])
        c2++;
      else
        c3++;
    }
    if (c1 == c2 && c2 == c3) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
