#include <bits/stdc++.h>
#pragma ARCENIY_KIRILLOV_UVIDEL_KROKODILOV
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  if (b.size() > 3) {
    cout << "No";
    return 0;
  }
  if (b.size() == 3) {
    vector<pair<int, int> > c;
    for (auto x : b) c.push_back(x);
    if (c[0].first ^ c[1].first == c[2].first) {
      if (c[0].second == c[1].second && c[1].second == c[2].second) {
        cout << "Yes";
        return 0;
      }
    }
    cout << "No";
    return 0;
  }
  if (b.size() == 1) {
    int c;
    for (auto x : b) c = x.first;
    if (c == 0) {
      cout << "Yes";
    } else
      cout << "No";
    return 0;
  }
  int c = -1;
  int d = -1;
  for (auto x : b) {
    if (d == -1) {
      if (x.first != 0) {
        cout << "No";
        return 0;
      }
      d = x.second;
    } else
      c = x.second;
  }
  if (d + d == c) {
    cout << "Yes";
    return 0;
  }
  cout << "No";
}
