#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  int a[n];
  map<int, int> mp;
  bool all_zero = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (a[i] != 0) all_zero = false;
  }
  string ans = "No";
  if (all_zero) ans = "Yessssss";
  if (mp.size() == 3 && mp[1] == 3 && mp[2] == mp[3]) ans = "Yes";
  cout << ans << endl;
}
