#include <bits/stdc++.h>
using namespace std;
const int lim = 1e5 + 5;
const int mod = 1e9 + 7;
map<int, vector<int>> xor2;
multiset<int> build;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int arr[lim];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 1; i < n; i++) xor2[arr[i] ^ arr[0]].push_back(i);
  int p = -1;
  for (int i = 1; i < n; i++)
    if (xor2.find(arr[i]) != xor2.end()) {
      if (xor2[arr[i]].size() >= 2)
        p = xor2[arr[i]][0] == i ? xor2[arr[i]][1] : xor2[arr[i]][0];
      else if (xor2[arr[i]][0] != i)
        p = i;
    }
  if (p == -1) {
    cout << "No";
    return 0;
  }
  for (int i = 1; i < n; i++)
    if (i != p) build.insert(arr[i]);
  int x1 = arr[0], x2 = arr[p];
  for (int i = 2; i < n; i++) {
    if (build.find(x1 ^ x2) == build.end()) {
      cout << "No";
      return 0;
    } else {
      build.erase(build.find(x1 ^ x2));
      int tmp = x1;
      x1 = x2;
      x2 = x1 ^ tmp;
    }
  }
  if ((arr[0] ^ x1 ^ x2) != 0)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
