#include <bits/stdc++.h>
const int MN = 100005;
int N, A[MN], B[MN], C[MN], M;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", &A[i]), B[i] = A[i];
  std::sort(B + 1, B + N + 1), M = std::unique(B + 1, B + N + 1) - B - 1;
  if (M > 3) return puts("No"), 0;
  if (M == 1) return puts(B[1] == 0 ? "Yes" : "No"), 0;
  if (M == 2 && B[1] != 0) return puts("No"), 0;
  if (N % 3 != 0) return puts("No"), 0;
  for (int j = 1; j <= M; ++j)
    for (int i = 1; i <= N; ++i)
      if (A[i] == B[j]) ++C[j];
  if (M == 2 && (C[1] != N / 3 * 2 || C[2] != N / 3)) return puts("No"), 0;
  if (M == 3 && (C[1] != N / 3 || C[2] != N / 3 || C[3] != N / 3))
    return puts("No"), 0;
  puts("Yes");
  return 0;
}
