#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  bool p = true;
  ll n;
  cin >> n;
  ll a[110000];
  for (ll i = ll(0); i < ll(n); i++) cin >> a[i];
  ll ans = 0;
  sort(a, a + n);
  if (n % 3 == 0) {
    if (a[n / 3] != abs(a[0] - a[2 * n / 3])) p = false;
  } else
    p = false;
  if (p)
    cout << "Yes";
  else
    cout << "No";
}
