#include <bits/stdc++.h>
using namespace std;
int binary(int bina);
int main() {
  int i, j;
  long long int N;
  cin >> N;
  string ans = "Yes";
  vector<unsigned long long int> a(N);
  for (i = 0; i < N; ++i) {
    cin >> a[i];
  }
  for (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;
}
