#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a;
  map<int, int> ss;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    ss[a]++;
  }
  pair<int, int> u[3];
  if (ss.size() == 1) {
    if (ss.begin()->first == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (ss.size() == 2 && n % 2 == 0) {
    auto it = ss.begin();
    u[0] = *it;
    it++;
    u[1] = *it;
    it++;
    if (u[0].first == 0 || u[1].first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (ss.size() != 3 || n % 3 != 0) {
    puts("No");
    return 0;
  }
  auto it = ss.begin();
  u[0] = *it;
  it++;
  u[1] = *it;
  it++;
  u[2] = *it;
  it++;
  if ((u[0].first ^ u[1].first) == u[2].first && u[0].second == n / 3 &&
      u[1].second == n / 3)
    puts("Yes");
  else
    puts("No");
  return 0;
}
