#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j;
  cin >> N;
  vector<int> a(N);
  vector<int> index(N);
  for (i = 0; i < N; i++) {
    cin >> a.at(i);
    index.at(i) = i;
  }
  string ret = "Yes";
  bool res = 1;
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      if (i != j) {
        res = (a.at(i) ^ a.at(j) == (a.at(0) ^ a.at(1)));
        if (res == 0) {
          res = "No";
          break;
        }
      }
    }
  }
  cout << ret << endl;
}
