#include <bits/stdc++.h>
using namespace std;
int N;
const int MAX_N = 1.0e5 + 100;
int A[MAX_N];
int main() {
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    mp[A[i]]++;
  }
  if (mp[0] == N) {
    cout << "Yes" << endl;
  } else if (N % 3 == 0) {
    bool f = false;
    int zero;
    int xyz[3];
    int i = 0;
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      int key = itr->first;
      int val = itr->second;
      if (key == 0) {
        zero = val;
      } else {
        if (i >= 3) {
          break;
        }
        xyz[i] = val;
        i++;
      }
    }
    if (zero == N / 3 && xyz[0] == 2 * N / 3) {
      cout << "Yes" << endl;
    } else if (xyz[0] == N / 3 && xyz[1] == N / 3 && xyz[2] == N / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
