#include <bits/stdc++.h>
using ll = long long;
using itn = int;
using namespace std;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int main() {
  int n;
  cin >> n;
  ll a[n + 2];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  a[n] = a[0];
  a[n + 1] = a[1];
  for (int i = 1; i < n + 1; i++) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      bool find = false;
      for (int j = i + 1; i < n; i++) {
        if (a[i - 1] ^ a[j] == a[i]) {
          swap(a[i + 1], a[j]);
          find = true;
          break;
        }
      }
      if (!find) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
