#include <bits/stdc++.h>
using namespace std;
int f(int a, int b) { return a ^ b; }
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  multiset<int> s;
  for (int(i) = 0; (i) < (N); (i)++) {
    cin >> A[i];
    s.insert(A[i]);
  }
  int tmp = -1;
  vector<int> t;
  for (auto itr = s.begin(); itr != s.end(); itr++) {
    if (tmp != *itr) {
      t.push_back(*itr);
    }
    tmp = *itr;
  }
  int size = t.size();
  if (size == 1) {
    if (s.count(0) != 0)
      cout << "Yes";
    else
      cout << "No";
  }
  if (size == 2) {
    if (N % 3 == 0 && s.count(0) == N / 3)
      cout << "Yes";
    else
      cout << "No";
  }
  if (size == 3) {
    if (N % 3 == 0 && s.count(t[0]) == N / 3 && s.count(t[1]) == N / 3 &&
        s.count(t[2]) == N / 3) {
      cout << "Yes";
    } else
      cout << "No";
  }
  if (size >= 4) cout << "No";
  return 0;
}
