#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int a[100010], three[3], count[3] = {};
  for (int i = 0; i < 3; i++) three[i] = -1;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i; i < n; i++) {
    cin >> a[i];
    bool next = false;
    for (int j = 0; j < 3; j++) {
      if (a[i] == three[j]) {
        count[j]++;
        next = true;
      }
    }
    if (next) continue;
    for (int j = 0; j < 3; j++) {
      if (three[j] == -1) {
        three[j] = a[i];
        count[j]++;
        next = true;
        break;
      }
    }
    if (!next) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (!(count[0] == count[1] and count[1] == count[2])) {
    cout << "No" << endl;
  }
  int m = max({count[0], count[1], count[2]});
  int keta = 1;
  while (m) {
    m /= 2;
    keta++;
  }
  for (int i = 0; i < keta; i++) {
    int a0 = three[0] % 2, a1 = three[1] % 2, a2 = three[2] % 2;
    three[0] /= 2;
    three[1] /= 2;
    three[2] /= 2;
    vector<int> v = {three[0], three[1], three[2]};
    if ((three[0] + three[1] + three[2]) % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
