#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long prev, cur, next;
  cin >> prev;
  cin >> cur;
  long long first = prev;
  long long second = cur;
  for (int i = 0; i < n - 2; i++) {
    cin >> next;
    if ((prev ^ next) != cur) {
      cout << "No" << endl;
      return 0;
    }
    prev = cur;
    cur = next;
  }
  if ((prev ^ first) != cur) {
    cout << "No" << endl;
    return 0;
  }
  if ((cur ^ second) != first) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
