#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];
  sort(a.begin(), a.end());
  int ex2 = log(a[N - 1]);
  for (int i = 0; i < ex2; i++) {
    int num0 = 0;
    int num1 = 0;
    for (int i = 0; i < N; i++) {
      if (a[i] % 2 == 0)
        num0++;
      else
        num1++;
      a[i] = a[i] / 2;
    }
    if (!(num0 * 2 == num1 || num0 == num1 * 2)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
