#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> vec(n);
  vector<pair<long long, long long>> temp(3);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  vec.emplace_back(-1);
  int k = 0;
  int i = 0;
  while (i < n) {
    int num = 0;
    if (k > 2) {
      cout << "No";
      return 0;
    }
    temp[k].first = vec[i];
    do {
      num++;
    } while (vec[i + num] >= 0 && vec[i] == vec[i + num]);
    temp[k].second = num;
    k++;
    i += num;
  }
  if ((k == 2 && temp[0].second == temp[1].second && temp[0].first == 0 &&
       temp[1].first == 1) ||
      (k == 3 && temp[0].second == temp[1].second &&
       temp[0].second == temp[2].second &&
       temp[0].first ^ temp[1].first ^ temp[2].first == 0))
    cout << "Yes";
  else
    cout << "No";
}
