#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  while (cin >> N) {
    map<int, int> m;
    for (int i = 0; i < N; i++) {
      int a;
      cin >> a;
      m[a]++;
    }
    if (m.size() != 3) {
      cout << "No" << endl;
    } else {
      vector<int> v;
      for (auto p : m) {
        v.push_back(p.second);
      }
      if (v[0] == v[1] && v[1] == v[2]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
}
