#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 5;
const long long inf = 0x3f3f3f3f;
int main() {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 2; i <= n - 1; i++) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((a[n] ^ a[2]) != a[1] || (a[n - 1] ^ a[1]) != a[n]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
