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