#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  map<int, int> xs;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++xs[x];
  }
  if (xs.size() > 3 || xs.size() == 2 ||
      (xs.size() == 1 && xs.begin()->first != 0))
    cout << "No\n";
  else if (xs.size() == 3) {
    if (xs.begin()->second != next(xs.begin())->second ||
        xs.begin()->second != next(next(xs.begin()))->second ||
        ((xs.begin()->first ^ next(xs.begin())->first) !=
         next(next(xs.begin()))->first))
      cout << "No\n";
    else
      cout << "Yes\n";
  } else
    cout << "Yes\n";
}
