#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];
  set<int> num;
  for (int x : a) {
    num.insert(x);
    if (num.size() == 4) break;
  }
  if (num.size() != 3)
    cout << "No" << endl;
  else {
    vector<int> x;
    for (int y : num) x.push_back(y);
    bool fl = true;
    vector<int> xnum(3, 0);
    for (int y : a) {
      if (y == x[0]) xnum[0]++;
      if (y == x[1]) xnum[1]++;
      if (y == x[2]) xnum[2]++;
    }
    if (!(xnum[0] == xnum[1] && xnum[1] == xnum[2])) fl = false;
    while (x[0] != 0 && x[1] != 0 && x[2] != 0) {
      int xx = x[0] % 2, yy = x[1] % 2, zz = x[2] % 2;
      if ((xx + yy + zz) % 2 != 0) {
        fl = false;
        break;
      }
      x[0] /= 2;
      x[1] /= 2;
      x[2] /= 2;
    }
    if (fl)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
