#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, i, x;
  map<int, int> l;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> x;
    if (l.count(x))
      l.at(x)++;
    else
      l[x] = 1;
  }
  if (l.size() == 3) {
    ll c[3];
    i = 0;
    for (pair<int, int> p : l) {
      c[i] = p.first;
      i++;
    }
    if (c[0] + c[1] == c[2] && l.at(c[0]) == l.at(c[1]) &&
        l.at(c[1]) == l.at(c[2]))
      cout << "Yes";
    else if (c[2] / 2 == c[0]) {
      int p = 0, q = c[1] - c[0];
      while (c[2] % 2 == 0) {
        p++;
        c[2] /= 2;
      }
      for (int r = 0; r < p; r++) q /= 2;
      if (q == 1)
        cout << "Yes";
      else
        cout << "No";
    } else
      cout << "No";
  } else if (l.size() == 2) {
    int c[2];
    i = 0;
    for (pair<int, int> p : l) {
      c[i] = p.first;
      i++;
    }
    if (c[0] == 0 && l.at(c[0]) == l.at(c[1]))
      cout << "Yes";
    else
      cout << "No";
  } else
    cout << "No";
  cout << endl;
}
