#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int n, a[3], t[3];
int main() {
  scanf("%d", &n), a[0] = a[1] = a[2] = INF;
  if (n % 3) return printf("No"), 0;
  for (int i = 1, x, j; i <= n; i++) {
    scanf("%d", &x);
    for (j = 0; j < 3; j++)
      if (a[j] == INF) {
        a[j] = x, ++t[j];
        break;
      } else if (a[j] == x) {
        ++t[j];
        break;
      }
    if (j >= 3) return printf("No"), 0;
  }
  if (t[0] == n / 3 && t[1] == t[0]) return printf("Yes"), 0;
  n = n / 3;
  if (a[0] > a[1]) swap(a[0], a[1]), swap(t[0], t[1]);
  if (t[0] == n && t[1] == n * 2 && a[0] == 0) return printf("Yes"), 0;
  if (t[0] == n * 3 && a[0] == 0) return printf("Yes"), 0;
  return printf("No"), 0;
}
