#include <bits/stdc++.h>
using namespace std;
const int Log = 31, maxn = 1e5 + 5;
unordered_map<int, int> bio;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a;
  vector<int> l;
  int br = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!bio[a]) {
      bio[a] = 1;
      br++;
      l.push_back(a);
    } else {
      bio[a]++;
    }
  }
  sort(l.begin(), l.end());
  if (br == 3) {
    if (bio[l[0]] == bio[l[1]] && bio[l[1]] == bio[l[2]]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  } else if (br < 3 && bio[0]) {
    if (br == 1) {
      cout << "Yes\n";
    } else if (br == 2 && bio[0] * 2 == bio[l[1]]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  } else {
    cout << "No\n";
  }
  return 0;
}
