#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000 + 17;
int n, a[MAXN];
map<int, int> mp;
set<int> s;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], s.insert(a[i]), mp[a[i]]++;
  if (s.size() > 3) return cout << "No\n", 0;
  if (s.size() == 1) {
    if (mp[a[1]] != n)
      return cout << "No\n", 0;
    else
      return cout << "Yes\n", 0;
  }
  if (n % 3 != 0) return cout << "No\n", 0;
  if (s.size() == 3) {
    for (auto i : s)
      if (mp[i] ^ mp[a[1]]) return cout << "No\n", 0;
    return cout << "Yes\n", 0;
  }
  if (*s.begin() != 0) return cout << "No\n", 0;
  if (mp[0] * 2 != mp[*s.rbegin()]) return cout << "No\n", 0;
  cout << "Yes\n";
  return 0;
}
