#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  map<int, int> C;
  for (int i = 0; i < N; ++i) cin >> A[i], ++C[A[i]];
  sort(A.begin(), A.end());
  if (A[0] == A.back() and A[0] == 0) {
    puts("Yes");
    return 0;
  }
  if (N % 3 or C.size() > 3) {
    puts("No");
    return 0;
  }
  for (auto e : C) {
    if (e.second % (N / 3)) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
}
