#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> hats;
  set<int> rep;
  cin >> n;
  hats.resize(n);
  for (int x = 0; x < n; x++) {
    cin >> hats[x];
    rep.insert(hats[x]);
  }
  if (rep.size() == 3 && !(n % 3)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
