#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool ans = true;
  if (n % 3 == 0) {
    vector<int> v;
    map<int, int> m;
    for (int i = 0; i < n; i++) {
      int tmp;
      cin >> tmp;
      if (m[tmp] == 0) {
        v.push_back(tmp);
      }
      m[tmp]++;
    }
    sort(v.begin(), v.end());
    if (v[0] == 0) {
      ans = m[0] == n / 3 && m[v[1]] == n * 2 / 3;
    } else {
      ans = m[v[0]] == n / 3 && m[v[1]] == n / 3 && m[v[2]] == n / 3;
    }
  } else {
    for (int i = 0; i < n; i++) {
      int tmp;
      cin >> tmp;
      if (tmp != 0) {
        ans = false;
        break;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
