#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int z = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      z++;
    }
  }
  if (z == n) {
    cout << "Yes" << endl;
  }
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  if (mp.size() >= 4 || mp.size() == 1 || n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  if (mp.size() == 3 && a[0] == a[n / 3 - 1] && a[n / 3] == a[n / 3 * 2 - 1] &&
      a[n / 3 * 2] == a[n - 1]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (mp.size() == 2 && a[0] == 0 && a[n / 3 - 1] == 0 &&
      a[n / 3] == a[n - 1]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
