#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
int A[MAX_N];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  set<int> S;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    S.insert(A[i]);
  }
  if (S.size() == 3 && N % 3 == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
