#include <bits/stdc++.h>
using namespace std;
int a[100050], num[100050];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int now = 0;
  a[0] = -1;
  for (int i = 1; i <= n; i++) {
    if (a[i] != a[i - 1]) now++;
    num[now]++;
  }
  if (now > 3)
    printf("No\n");
  else {
    if (now == 1) {
      if (a[1] != 0)
        printf("No\n");
      else
        printf("Yes\n");
    } else if (now == 2) {
      if (num[1] == 2 * num[2] || num[2] == 2 * num[1])
        printf("Yes\n");
      else
        printf("No\n");
    } else {
      if (num[1] == num[2] && num[2] == num[3])
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
