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