#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  if (count(a.begin(), a.end(), 0) == n) return puts("Yes"), 0;
  if (n % 3 != 0) return puts("No"), 0;
  set<int> S(a.begin(), a.end());
  if (S.size() != 3) return puts("No"), 0;
  for (auto x : S)
    if (count(a.begin(), a.end(), x) != n / 3) return puts("No"), 0;
  puts("Yes");
  return 0;
}
