#include <bits/stdc++.h>
const double PI = acos(-1);
const int MAXX = 1000005;
const int maxInt = 2147483647;
using namespace std;
int vis[MAXX], dis[MAXX];
unsigned long long int n, cnt, xxor;
unsigned long long int arr[MAXX];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cnt = 0;
  for (int i = (1); i <= (n); ++i) cin >> arr[i];
  for (int i = (1); i <= (n); ++i) {
    unsigned long long int alt = (i - 1);
    unsigned long long int ust = (i + 1);
    if (alt == 0) alt = n;
    if (ust > n) ust = 1;
    xxor = arr[alt] ^ arr[ust];
    if (xxor == arr[i]) {
      cnt += 1;
    }
  }
  if (cnt == n)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
  return 0;
}
