#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<int, int> cnt;
  int total = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    cnt[a]++;
    total++;
  }
  bool ans = true;
  if (n % 3 || cnt.size() != 3)
    ans = false;
  else {
    for (auto &p : cnt) {
      if (p.second * 3 != total) {
        ans = false;
        break;
      }
    }
  }
  if (ans) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
