#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ai, i, t = 0;
  long k = 1;
  cin >> n;
  vector<int> ab(1e5 + 1, 0);
  for (i = 0; i < n; i++) {
    cin >> ai;
    if (ab.at(ai) == 0) t++;
    ab.at(ai)++;
  }
  if (ab.at(0) == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (t != 3) {
    cout << "No" << endl;
    return 0;
  }
  int a, b, c;
  vector<int> m;
  for (i = 0; i < 1e5 + 1; i++) {
    if (ab.at(i)) {
      m.push_back(i);
      if (ab.at(i) != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  for (i = 0; i < 31; i++) {
    a = (m.at(0) & k);
    b = (m.at(1) & k);
    c = (m.at(2) & k);
    if (a + b + c != 2 * k && a + b + c != 0) break;
    k *= 2;
  }
  if (i == 31)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
