#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a[3];
  int c[] = {0, 0, 0};
  int idx = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int tmp;
    bool flag = true;
    cin >> tmp;
    for (int j = 0; j < idx && j < 3; j++) {
      if (a[j] == tmp) {
        flag = false;
        c[j]++;
      }
    }
    if (flag) {
      if (idx >= 3) {
        cout << "No" << endl;
        return 0;
      }
      a[idx] = tmp;
      c[idx]++;
      idx++;
    }
  }
  if (idx == 0 && a[0] == 0) {
    cout << "Yes" << endl;
  } else if (idx == 3 && a[0] | a[1] | a[2] == 0 && c[0] == c[1] &&
             c[1] == c[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
