#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> cnt;
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    ++cnt[a];
  }
  if (cnt.size() == 1)
    printf("Yes\n");
  else if (n % 3)
    printf("No\n");
  else if (cnt.size() != 3)
    printf("No\n");
  else {
    bool ok = true;
    for (auto& v : cnt)
      if (v.second != n / 3) ok = false;
    printf(ok ? "Yes\n" : "No\n");
  }
}
