#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  a.push_back(a[0]);
  a.push_back(a[1]);
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if ((a[i] ^ a[i + 1]) != a[i + 2]) {
      flag = false;
    }
  }
  cout << (flag ? "Yes" : "No") << endl;
  return 0;
}
