#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MOD2 = 998244353;
const long long MOD3 = 1812447359;
const long long INF = 1ll << 62;
const double PI = 2 * asin(1);
void yes() { printf("yes\n"); }
void no() { printf("no\n"); }
void Yes() { printf("Yes\n"); }
void No() { printf("No\n"); }
void YES() { printf("YES\n"); }
void NO() { printf("NO\n"); }
int N;
long long A[int(1e5 + 5)], ans;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    ans ^= A[i];
  }
  if (ans != 0) {
    No();
    return 0;
  }
  for (int i = 1; i <= N; i++) {
    int next = i + 3;
    if (next > N) next -= N;
    if (A[i] != A[next]) {
      No();
      return 0;
    }
  }
  Yes();
  return 0;
}
