#include <bits/stdc++.h>
using namespace std;
template <class Read>
void in(Read &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    f |= (ch == '-');
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x = f ? -x : x;
  return;
}
int n, a[1000005];
map<int, int> v;
int main() {
  in(n);
  for (int i = 1; i <= n; i++) in(a[i]);
  for (int i = 2; i <= n; i++) v[a[i] ^ a[i - 1]] = 1;
  v[a[1] ^ a[n]] = 1;
  for (int i = 1; i <= n; i++) {
    if (!v[i]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}
