#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(100010);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool flag = true;
  if ((a[1] ^ a[n - 1]) != a[0]) {
    for (int i = 2; i <= n - 2; ++i) {
      if (a[i] == (a[1] ^ a[n - 1])) {
        swap(a[0], a[i]);
        break;
      }
      flag = false;
    }
  }
  for (int i = 1; i < n - 1; ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      for (int j = i + 2; j <= n - 2; ++j) {
        if (a[j] == (a[i - 1] ^ a[i + 1])) {
          swap(a[i], a[j]);
          break;
        }
        flag = false;
      }
    }
  }
  if ((a[0] ^ a[n - 2]) != a[n - 1]) flag = false;
  cout << (flag ? "Yes" : "No") << '\n';
  return 0;
}
