#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<long long int, int> mp;
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    mp[x]++;
  }
  if (mp.size() > 3) {
    cout << "No";
    return 0;
  }
  auto it = mp.begin();
  if (mp.size() == 1) {
    if (it->first == 0) {
      cout << "Yes";
    } else
      cout << "No";
  }
  if (mp.size() == 2) {
    if (it->first == 0 and n % 3 == 0) {
      int f1 = it->second;
      it++;
      int x = it->first;
      int f2 = it->second;
      if (f1 == n / 3 and f2 == (2 * n) / 3)
        cout << "Yes";
      else
        cout << "No";
      return 0;
    } else
      cout << "No";
    return 0;
  }
  if (mp.size() == 3) {
    int f1 = it->second;
    it++;
    int f2 = it->second;
    it++;
    int f3 = it->second;
    it++;
    if (f1 == n / 3 and f2 == n / 3 and f3 == n / 3 and n % 3 == 0)
      cout << "Yes";
    else
      cout << "No";
    return 0;
  }
}
