#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int cmp(pair<long long int, long long int> a,
        pair<long long int, long long int> b) {
  if (a.first != b.first)
    return a.first > b.first;
  else
    return a.second < b.second;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n;
  cin >> n;
  vector<long long int> a(n + 1);
  for (int i = 0; i < n; i++) cin >> a[i];
  a.push_back(a[0]);
  a.push_back(a[1]);
  bool abc = true;
  for (int i = 1; i <= n; i++) {
    long long int c = a[i - 1] ^ a[i + 1];
    if (c != a[i]) {
      abc = false;
      break;
    }
  }
  if (abc == false)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
