#include <bits/stdc++.h>
using namespace std;
int a[100001], n, b[100001];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i < n)
      b[i] = a[i] ^ a[i + 1];
    else
      b[i] = a[i] ^ a[1];
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    if (b[i] != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
