#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, flag = 0;
  cin >> n;
  vector<ll> a(n);
  for (ll i = 0; i < n; i++) cin >> a[i];
  if (a[0] == (a[1] ^ a[n - 1])) flag++;
  if (a[n - 1] == (a[0] ^ a[n - 2])) flag++;
  for (ll i = 1; i < n - 1; i++) {
    if (a[i] == (a[i - 1] ^ a[i + 1])) flag++;
  }
  if (flag == n)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
