#include <bits/stdc++.h>
using namespace std;
static const int INF = INT_MAX;
static const long long LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const long long LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;
int dx[] = {0, -1, 1, 0};
int dy[] = {-1, 0, 0, 1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  bool flg = true;
  for (int i = 1; i < n - 1; ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) flg = false;
  }
  if (((a[n - 1] ^ a[1]) != a[0]) || ((a[n - 2] ^ a[0]) != a[n - 1]))
    flg = false;
  if (!flg)
    cout << "No";
  else
    cout << "Yes";
  cout << '\n';
  return 0;
}
