#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  map<long long int, long long int> d;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    d[a[i]]++;
  }
  long long int b[n];
  b[0] = a[0];
  b[1] = -1;
  d[a[0]]--;
  for (int i = 0; i < n; i++) {
    if (d[a[i]] && d[a[0] ^ a[i]]) {
      b[1] = a[i];
      d[a[i]]--;
      break;
    }
  }
  if (b[1] == -1) {
    cout << "No";
    return 0;
  }
  for (long long int i = 2; i < n; i++) {
    long long int here = b[i - 1] ^ b[i - 2];
    if (d[here]) {
      d[here]--;
      b[i] = here;
    } else {
      cout << "No";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    int left = (i - 1 + n) % n;
    int right = (i + 1) % n;
    if ((a[left] ^ a[right]) != a[i]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
