#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 (cnt.size() == 1 && cnt.begin()->first == 0) {
    ans = true;
  } else {
    total /= 3;
    if (n % 3 || cnt.size() > 3)
      ans = false;
    else {
      for (auto &p : cnt) {
        if (p.second % total) {
          ans = false;
          break;
        }
      }
    }
  }
  if (ans) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
