#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  map<long long, int> mp;
  for (int i = 0; i < (n); ++i) {
    long long a;
    cin >> a;
    ++mp[a];
  }
  if (mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 1) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      for (auto tmp_mp : mp) {
        if (tmp_mp.first == 0) {
          cout << "Yes" << endl;
          return 0;
        } else {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  } else {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (mp.size() == 3) {
      int tmp_num;
      bool flg = false;
      for (auto tmp_mp : mp) {
        if (!flg) {
          tmp_num = tmp_mp.second;
          flg = true;
        } else if (tmp_num != tmp_mp.second) {
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
    } else if (mp.size() == 2) {
      int num1, num2;
      for (auto tmp_mp : mp) {
        if (tmp_mp.first == 0) {
          num1 = tmp_mp.second;
        } else {
          num2 = tmp_mp.second;
        }
      }
      if (num1 * 6 == num2 * 3) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  return 0;
}
