#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long int> a(N), a_uni(N), a_cnt(3, 0);
  for (int i = 0; i < (int)(N); i++) {
    cin >> a[i];
    a_uni[i] = a[i];
  }
  sort(a_uni.begin(), a_uni.end());
  decltype(a_uni)::iterator result = unique(a_uni.begin(), a_uni.end());
  a_uni.erase(result, a_uni.end());
  if (a_uni.size() == 1) {
    if (a_uni[0] != 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else if (a_uni.size() == 2) {
    if (a_uni[0] == 0) {
      for (int i = 0; i < (int)(N); i++) {
        if (a[i] == 0) {
          a_cnt[0]++;
        } else {
          a_cnt[1]++;
        }
      }
      if (a_cnt[1] == a_cnt[0] * 2) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else if (a_uni.size() == 3 && a_cnt[0] == 0) {
    for (int i = 0; i < (int)(N); i++) {
      if (a[i] == a_uni[0]) {
        a_cnt[0]++;
      } else if (a[i] == a_uni[1]) {
        a_cnt[1]++;
      } else {
        a_cnt[2]++;
      }
    }
    if (a_cnt[0] == a_cnt[1] && a_cnt[1] == a_cnt[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
