#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long N;
  cin >> N;
  vector<unsigned long> v(N);
  for (unsigned long i = 0; i < N; ++i) {
    cin >> v[i];
  }
  int cnt = 1;
  int temp = v[0];
  unsigned long three[3];
  three[0] = v[0];
  if (N % 3 == 0) {
    for (unsigned long i = 0; i < N; ++i) {
      if (temp != v[i]) {
        cnt += 1;
      }
      if (cnt > 3) {
        cout << "No" << endl;
        return 0;
      }
      three[cnt - 1] = v[i];
    }
    if (cnt != 3) {
      cout << "No" << endl;
      return 0;
    }
    if ((N / 3 == count(v.begin(), v.end(), three[0])) &&
        (N / 3 == count(v.begin(), v.end(), three[1]))) {
      if (three[0] == (three[1] ^ three[2])) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
}
