#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long long MAX = 9000000000000000000;
const long long MIN = -9000000000000000000;
const long double DMAX = 4500;
const long double DMIN = -4500;
const long long MOD = 1000000007;
template <typename T>
void fin(T a) {
  cout << a << endl;
  exit(0);
}
void Main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  bool ans = true;
  if (a[0] != (a[1] ^ a[n - 1])) ans = false;
  if (a[n - 1] != (a[0] ^ a[n - 2])) ans = false;
  for (long long i = 1; i < n - 1; i++) {
    if (a[i] != (a[i - 1] ^ a[i + 1])) ans = false;
  }
  if (ans)
    fin("Yes");
  else
    fin("No");
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  Main();
  return 0;
}
