#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int a[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  map<int, int> d;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ++d[a[i]];
  }
  if (d[0] == n) {
    cout << "Yes\n";
    exit(0);
  }
  sort(a, a + n);
  int t = unique(a, a + n) - a;
  if (a[0] == 0) {
    if (d[a[1]] == d[0] && t == 2) {
      cout << "Yes\n";
      exit(0);
    } else {
      cout << "No\n";
      exit(0);
    }
  }
  if (t == 3 && d[a[0]] == d[a[1]] && d[a[0]] == d[a[2]]) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
