#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  ;
  int A[N];
  bool is_zero = true;
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
    ;
    if (A[i] != 0) is_zero = false;
  }
  if (is_zero) {
    cout << "Yes"
         << "\n";
  } else if (N % 3 != 0) {
    cout << "No"
         << "\n";
  } else {
    sort(A, A + N);
    for (int k = 0; k < (3); ++k) {
      for (int i = N / 3 * k; i < (N / 3 * (k + 1)); ++i) {
        if (A[i] != A[N / 3 * k]) {
          cout << "No"
               << "\n";
          return 0;
        }
      }
    }
    int x = A[0], y = A[N / 3], z = A[N / 3 * 2];
    if (x == 0 && y == z)
      cout << "Yes"
           << "\n";
    else if (x != y && y != z)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
