#include <bits/stdc++.h>
using namespace std;
const long long N = 100010, mod = 1e9 + 7;
map<int, int> m;
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    m[x]++;
  }
  for (int i = 2; i < mod; i *= 2) {
    if (i >= mod / 2) break;
    if (m[i] == m[i + 1] && m[i] == m[1] && 3 * m[1] == n) {
      puts("Yes");
      return 0;
    }
  }
  puts("No");
  return 0;
}
