#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
int main() {
  int n;
  cin >> n;
  int tmp;
  vector<int> vec(n);
  set<int> st;
  map<int, int> mp;
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> vec[i];
    if (mp[vec[i]] == 0)
      mp[vec[i]] += 2;
    else
      mp[vec[i]] += 1;
  }
  for (int(i) = (0); (i) < (n); (i)++) {
    int tmp = vec[(i - 1 + n) % n] ^ vec[(i + 1) % n];
    if (mp[tmp] == 0) {
      cout << "No" << endl;
      return 0;
    } else {
      mp[tmp]--;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
