#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N, a;
  cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) {
    cin >> a;
    A[i] = a;
  }
  string ans = "Yes";
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      if (A[i] != (A[N - 1] ^ A[i + 1])) {
        ans = "No";
        break;
      }
    } else if (i == N - 1) {
      if (A[i] != (A[i - 1] ^ A[0])) {
        ans = "No";
        break;
      }
    } else {
      if (A[i] != (A[i - 1] ^ A[i + 1])) {
        ans = "No";
        break;
      }
    }
  }
  cout << ans << endl;
}
