#include <bits/stdc++.h>
using namespace std;
int a[100005];
unordered_map<int, int> mp;
int main() {
  int n, num = 0;
  bool f = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (mp[a[i]] == 0) num++;
    mp[a[i]]++;
  }
  if (n % 3 != 0) f = 0;
  sort(a + 1, a + n + 1);
  int len = unique(a + 1, a + n + 1) - a - 1;
  if (mp[0]) {
    if (num != 2) f = 0;
    if (mp[a[2]] != 2 * mp[a[1]]) f = 0;
  } else {
    if (num != 3) f = 0;
    if (mp[a[1]] != mp[a[2]]) f = 0;
    if (mp[a[2]] != mp[a[3]]) f = 0;
  }
  if (mp[0] == n) f = 1;
  if (f)
    puts("Yes");
  else
    puts("No");
}
