#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(n), fail;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool flag = true;
  if ((a[1] ^ a[n - 1]) != a[0]) {
    fail.push_back(a[0]);
    fail.push_back(a[1] ^ a[n - 1]);
  }
  if ((a[0] ^ a[n - 2]) != a[n - 1]) {
    fail.push_back(a[n - 1]);
    fail.push_back(a[0] ^ a[n - 2]);
  }
  for (int i = 1; i < n - 1; ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      fail.push_back(a[i]);
      fail.push_back(a[i - 1] ^ a[i + 1]);
    }
  }
  map<int, int> mp;
  for (int i = 0; i < (fail.size()); ++i) {
    mp[fail[i]]++;
  }
  for (auto elem : mp) {
    if (elem.second % 2 == 0) flag = false;
  }
  cout << (flag ? "Yes" : "No") << '\n';
  return 0;
}
