#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, o = 0, i, j, k;
  int pre, now, nex, fir, sec, sum = 0, range = 0;
  cin >> n;
  cin >> pre >> now;
  fir = pre;
  sec = now;
  for (i = 3; i <= n; i++) {
    cin >> nex;
    if ((pre ^ nex) != now) {
      cout << "No";
      return 0;
    }
    if (i == n) break;
    pre = now;
    now = nex;
  }
  if ((sec ^ nex) != fir || (fir ^ now) != nex)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
