#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A = 0, B = 0, C = 0;
  int a = -1, b = -1, c = -1;
  vector<int> p(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  if (N % 3 != 0) {
    cout << "No" << endl;
  } else {
    int Z = 0;
    int M = N / 3;
    for (int i = 1; i < N; i++) {
      if (i == M || i == 2 * M) {
        if (p[i] == p[i - 1]) {
          Z++;
          break;
        }
      } else {
        if (p[i] != p[i - 1]) {
          Z++;
          break;
        }
      }
    }
    if (Z == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
