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