#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INF64 = 3e18;
const unsigned long long HASHBASE = 1222827239ull;
const long long MODNUM = 1000000007ll;
int a[100010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  a[0] = a[n];
  for (int i = 1; i < n; ++i) {
    int q = a[i - 1] ^ a[i + 1];
    if (q != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
