#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<LL, LL>;
using VI = vector<int>;
using VVI = vector<VI>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void solve() {
  int N;
  int a[3];
  int count[3];
  cin >> N;
  for (int i = 0; i < (3); ++i) {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
    count[i] = 0;
  }
  for (int i = 0; i < (N - 3); ++i) {
    int tmp;
    cin >> tmp;
    if (tmp == a[0]) ++count[0];
    if (tmp == a[1]) ++count[1];
    if (tmp == a[2]) ++count[2];
    if (tmp != a[0] && tmp != a[1] && tmp != a[2]) {
      cout << "No" << endl;
      return;
    }
  }
  if (count[0] == count[1] && count[1] == count[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
int main() {
  int T = 1;
  for (int i = 0; i < T; ++i) {
    solve();
  }
}
