#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  bool p = true;
  ll n;
  cin >> n;
  ll a[110000];
  for (ll i = ll(0); i < ll(n); i++) cin >> a[i];
  ll cac = a[0];
  sort(a, a + n);
  if (n % 3 == 0) {
    if (a[0] != a[n / 3 - 1] || a[n / 3] != a[2 * n / 3 - 1] ||
        a[2 * n / 3] != a[n - 1])
      p = false;
    while (cac == 0 || cac >= a[2 * n / 3]) cac *= 2;
    if (a[n / 3] != (a[2 * n / 3]) - cac) p = false;
  } else if (a[n - 1] == 0 && n % 3 != 0)
    p = true;
  else
    p = false;
  if (p)
    cout << "Yes";
  else
    cout << "No";
}
