#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a > b) {
    swap(a, b);
  }
  while (b % a != 0) {
    b %= a;
    swap(a, b);
  }
  return a;
}
int kaijou(int n) {
  int a = 1;
  if (n == 0) {
    return 1;
  }
  for (int i = 0; i < n; i++) {
    a *= i + 1;
  }
  return a;
}
int ncr(int n, int r) {
  int a;
  if (n < 0 || r < 0 || n < r) {
    return 0;
  }
  a = kaijou(n) / kaijou(r) / kaijou(n - r);
  return a;
}
int main() {
  long long N, a = 1;
  bool ok = true;
  cin >> N;
  if (N % 3 != 0) ok = false;
  vector<long long> v(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (long long i = 1; i > 0; i++) {
    if (v[N - 1] - powl(2, i) < 0) {
      a = i;
      break;
    }
  }
  for (long long i = 1; i <= a; i++) {
    long long b = 0;
    for (int j = 0; j < N; j++) {
      b += v[j] % 2;
      v[j] = v[j] / 2;
    }
    if (b != N * 2 / 3 && b > 0) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
