#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> A;
  map<long long, int> a;
  multimap<long long, int> B;
  bool ans = true;
  long long c;
  for (int i = 1; i <= N; i++) {
    cin >> c;
    A.push_back(c);
    a.insert(make_pair(c, i));
    B.insert(make_pair(c, i));
  }
  auto iter = a.begin();
  if (a.size() == 1) {
    if (iter->first == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (a.size() > 3) {
    cout << "No" << endl;
    return 0;
  } else if (a.size() == 2) {
    if (iter->first == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  int i = 0;
  long long d[4];
  while (i < 3) {
    d[i] = iter->first;
    iter++;
    i++;
  }
  d[3] = d[0];
  long long x = d[0];
  for (int i = 1; i <= 2; i++) {
    x = x ^ d[i];
  }
  if (x != 0) {
    cout << "No" << endl;
    return 0;
  } else {
    for (int k = 0; k < 3; k++) {
      if (B.count(d[i]) % (N / 3) != 0) {
        ans = false;
        break;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
