#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-9;
const long long INF = 10e17;
double equal(double a, double b) { return fabs(a - b) < DBL_EPSILON; }
std::istream &operator>>(std::istream &in, set<int> &o) {
  int a;
  in >> a;
  o.insert(a);
  return in;
}
std::istream &operator>>(std::istream &in, queue<int> &o) {
  long long a;
  in >> a;
  o.push(a);
  return in;
}
bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  map<long long, int> m;
  for (long long l : v) m[l]++;
  if (m.find(0) != m.end() && m[0] == n) {
    cout << "Yes" << endl;
    return 0;
    ;
  }
  vector<long long> keys;
  for (auto e : m) keys.push_back(e.first);
  if (keys.size() == 2 && keys[0] == 0 && m[0] == n / 3 * 2) {
    cout << "Yes" << endl;
    return 0;
    ;
  }
  if (keys.size() == 3 && m[keys[0]] == n / 3 && m[keys[0]] == n / 3 &&
      m[keys[0]] == n / 3 && (keys[0] ^ keys[1] ^ keys[2]) == 0) {
    cout << "Yes" << endl;
    return 0;
    ;
  }
  cout << "No" << endl;
}
