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