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