#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];
  sort((a).begin(), (a).end());
  if (a[0] == a[n - 1]) {
    if (a[0] == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
    return 0;
  }
  if (n % 3) {
    cout << "No\n";
    return 0;
  }
  vector<int> a3(3);
  a3[0] = a[0];
  a3[1] = a[n / 3];
  a3[2] = a[2 * n / 3];
  if (a3[0] == 0 && a3[1] != a3[2]) {
    cout << "No\n";
    return 0;
  }
  if (a3[0] == a3[1] || a3[1] == a3[2]) {
    cout << "No\n";
    return 0;
  }
  for (int i = 0; i < (3); i++) {
    for (int j = ((i * n / 3) + 1); j < (n * (i + 1) / 3); j++) {
      if (a3[i] != a[j]) {
        cout << "No\n";
        return 0;
      }
    }
  }
  cout << "Yes\n";
  return 0;
  cout << "No\n";
  return 0;
}
