#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  for (int i = 1; i < (n - 1); ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      puts("No");
      return 0;
    }
  }
  if ((a[1] ^ a[n - 1]) != a[0] || (a[0] ^ a[n - 2]) != a[n - 1]) {
    puts("No");
    return 0;
  }
  puts("Yes");
  return 0;
}
