#include <bits/stdc++.h>
using namespace std;
const int INF = 1e+9;
const long long INFLL = 1e+17;
const long long MOD = 1e+9 + 7;
int N;
int a[100010];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  bool f = true;
  if (N % 3 == 0) {
    map<int, int> m;
    for (int i = 0; i < N; i++) m[a[i]]++;
    if (m.size() == 3) {
      for (auto itr = m.begin(); itr != m.end(); itr++) {
        if (itr->second != N / 3) {
          f = false;
          break;
        }
      }
    } else if (m.size() == 2) {
      for (auto itr = m.begin(); itr != m.end(); itr++) {
        if (itr->first == 0) {
          if (itr->second != N / 3) {
            f = false;
            break;
          }
        } else {
          if (itr->second != 2 * N / 3) {
            f = false;
            break;
          }
        }
      }
    } else
      f = false;
  } else {
    for (int i = 0; i < N; i++) {
      if (a[i] != 0) {
        f = false;
        break;
      }
    }
  }
  if (f)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
