#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(4);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x > 3 || x == 0) {
      cout << "No" << endl;
      return 0;
    } else
      a[x]++;
  }
  if (a[1] == a[2] == a[3]) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
