#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  int a;
  for (int i = 0; i < (n); ++i) {
    cin >> a;
    mp[a]++;
  }
  int m = mp.size();
  bool ans = false;
  if (mp[0] == n)
    ans = true;
  else if (m == 2 && mp[0] == n / 3 && n % 3 == 0)
    ans = true;
  else if (m == 3 && n % 3 == 0) {
    bool flag = true;
    for (auto p : mp)
      if (p.second && p.second != n / 3) flag = false;
    if (flag) ans = true;
  }
  if (ans)
    cout << "Yes";
  else
    cout << "No";
}
