#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  while (cin >> N) {
    vector<int> v;
    for (int i = 0; i < N; i++) {
      int a;
      cin >> a;
      v.push_back(a);
    }
    bool ok = true;
    for (int i = 0; i < N; i++) {
      int a, b, c;
      a = i;
      b = (i + 1) % N;
      c = (i + 2) % N;
      if ((v[a] ^ v[c]) != v[b]) {
        ok = false;
      }
    }
    if (ok) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
