#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  vector<ll> a(N);
  ll cnt = 0;
  for (ll i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      cnt++;
    }
  }
  bool ans = false;
  if (cnt == N) {
    ans = true;
  } else if (N % 3 == 0) {
    if (cnt == N / 3) {
      if (a[0] == 0 || a[1] == 0 || a[2] == 0) {
        ans = true;
        for (ll i = 3; i < N; i++) {
          if (a[i] != a[i % 3]) {
            ans = false;
            break;
          }
        }
      }
    } else if (((a[0] ^ a[1]) ^ a[0]) == a[1]) {
      ans = true;
      for (ll i = 3; i < N; i++) {
        if (a[i] != a[i % 3]) {
          ans = false;
          break;
        }
      }
    }
  }
  if (ans) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
