#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000];
signed main() {
  int i;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++)
    if (a[i] > 0) break;
  if (i == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (i = 0; i < n; i++)
    if (a[i] == 0) break;
  if (i < n) {
    int cnt = 0, t = -1;
    for (i = 0; i < n; i++)
      if (a[i] != 0) {
        t = a[i];
        cnt++;
      }
    if (cnt != n / 3 * 2) {
      cout << "No" << endl;
      return 0;
    }
    for (i = 0; i < n; i++)
      if (a[i] != 0 && a[i] != t) break;
    if (i < n) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
    return 0;
  }
  map<int, int> mp;
  for (i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  if (mp.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
    if (it->second != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
