#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) scanf(" %lld", &a[i]);
  if (N % 3 != 0) {
    std::cout << "No" << std::endl;
    return 0;
  }
  std::sort(a.begin(), a.end());
  int j = 0, k = 0;
  int count[3];
  for (int i = 0; i < 3; i++) count[i] = 0;
  count[0]++;
  for (int i = 1; i < N; i++) {
    if (a[i] == a[i - 1])
      count[j]++;
    else {
      j++;
      count[j]++;
    }
    if (j == 3) break;
  }
  if (j == 3)
    std::cout << "No" << std::endl;
  else if (j == 2 && count[0] == N / 3 && count[1] == N / 3)
    std::cout << "Yes" << std::endl;
  else if (j == 1 && (count[0] == N / 3 || count[1] == N / 3) && a[0] == 0)
    std::cout << "Yes" << std::endl;
  else if (j == 0 && a[0] == 0)
    std::cout << "Yes" << std::endl;
  else
    std::cout << "Yes" << std::endl;
}
