#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n;
int a[100010];
set<int> s;
int num[3];
int times[3];
int cnt;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  bool all0 = 1;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = x;
    if (x) all0 = 0;
    s.insert(x);
  }
  if (all0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (s.size() >= 4) {
    cout << "No" << endl;
    return 0;
  }
  for (auto ite = s.begin(); ite != s.end(); ite++) {
    num[cnt++] = *ite;
  }
  for (int i = 0; i < n; i++) {
    auto ite = s.lower_bound(a[i]);
    int p = 0;
    while (ite != s.begin()) {
      p++;
      ite--;
    }
    times[p]++;
  }
  if (cnt == 1)
    cout << "No" << endl;
  else if (cnt == 2) {
    if (times[0] == times[1] * 2 && num[1] == 0)
      cout << "Yes" << endl;
    else if (times[1] == times[0] * 2 && num[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (times[0] == times[1] && times[1] == times[2] &&
        num[0] ^ num[1] ^ num[2] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
