#include <bits/stdc++.h>
using namespace std;
long long n, a[100008];
int main() {
  cin >> n;
  map<long long, long long> mp;
  string ans = "No";
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    auto itr = mp.find(a[i]);
    if (itr != mp.end()) {
      itr->second = itr->second + 1;
    } else {
      mp[a[i]] = 1;
    }
  }
  if (mp.size() == 3) {
    auto itr = mp.begin();
    long long a = itr->first;
    long long ca = itr->second;
    itr++;
    long long b = itr->first;
    long long cb = itr->second;
    itr++;
    long long c = itr->first;
    long long cc = itr->second;
    if (ca == cb && cb == cc) {
      ans = "Yes";
      for (long long k = 0; k <= 50; k++) {
        bool ba = a & (1 << k);
        bool bb = b & (1 << k);
        bool bc = c & (1 << k);
        if ((ba && bb && bc) && (!ba && !bb && bc) && (ba && !bb && !bc) &&
            (!ba && bb && !bc)) {
          ans = "No";
        }
      }
    }
  }
  if (mp.size() == 2) {
    auto itr = mp.begin();
    long long a = itr->first;
    long long ca = itr->second;
    itr++;
    long long b = itr->first;
    long long cb = itr->second;
    if ((2 * ca == cb && a == 0) || (ca == 2 * cb && b == 0)) {
      ans = "Yes";
    }
  }
  if (mp.size() == 1) {
    auto itr = mp.begin();
    long long a = itr->first;
    if (a == 0) {
      ans = "Yes";
    }
  }
  cout << ans << endl;
  return 0;
}
