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