#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  map<long long int, long long int> d, dd;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    d[a[i]]++;
  }
  long long int b[n];
  b[0] = a[0], b[1] = a[1];
  for (long long int i = 2; i < n; i++) {
    b[i] = b[i - 1] ^ b[i - 2];
  }
  for (int i = 0; i < n; i++) {
    int left = (i - 1 + n) % n;
    int right = (i + 1) % n;
    if ((a[left] ^ a[right]) != a[i]) {
      cout << "No";
      return 0;
    }
  }
  for (long long int e : b) {
    dd[e]++;
  }
  cout << (d == dd ? "Yes" : "No");
}
