#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e18;
const double pi = 3.14159265358979323846;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) {
    if (a[i] != (int)(a[(i + 1) % n] ^ a[(i - 1 + n) % n])) {
      cout << "No"
           << "\n";
      return 0;
    }
  }
  cout << "Yes"
       << "\n";
}
