#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[112345];
  map<int, int> mp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() != 3) {
    if (mp.size() == 1) {
      if (a[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    if (mp.size() == 2) {
      int s = -1;
      int t = -1;
      for (auto i : mp) {
        if (s == -1)
          s = i.second;
        else
          t = i.second;
      }
      if (s * 2 == t || s == t * 2) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  int b = -1;
  for (auto i : mp) {
    if (b == -1)
      b = i.second;
    else {
      if (b != i.second) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
