#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const int mod = 1000000007;
struct three_set {
  map<int, int> a;
  bool insert(int x) {
    a[x]++;
    return a.size() <= 3;
  }
  vector<pair<int, int> > get() {
    vector<pair<int, int> > b(a.begin(), a.end());
    return b;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  three_set ts;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (!ts.insert(a)) {
      cout << "No" << '\n';
      return 0;
    }
  }
  auto a = ts.get();
  if (a.size() == 1 && a[0].first == 0) {
    cout << "Yes" << '\n';
    return 0;
  }
  if (a.size() != 3) {
    cout << "No" << '\n';
    return 0;
  }
  if (a[0].second != a[1].second || a[0].second != a[2].second ||
      a[1].second != a[2].second) {
    cout << "No" << '\n';
    return 0;
  }
  if ((a[0].first ^ a[1].first ^ a[2].first) != 0) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  return 0;
}
