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