#include <bits/stdc++.h>
using namespace std;
const bool DEBAG = true;
int main() {
  long long N;
  cin >> N;
  vector<long long> v(N);
  for (long long i = 0; i < N; i++) cin >> v[i];
  sort((v).begin(), (v).end());
  vector<long long> used;
  used.push_back(v[0]);
  for (int i = 0; i < N - 1; i++) {
    if (v[i] != v[i + 1]) used.push_back(v[i + 1]);
  }
  if (used.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (used.size() == 1 && used[0] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (used.size() == 2) {
    long long cnt = 0;
    long long no_cnt = 0;
    for (int i = 0; i < N; i++) {
      if (v[i] == v[0])
        cnt++;
      else
        no_cnt++;
    }
    if (N % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (cnt != N / 3 && cnt != N / 3 * 2) {
      cout << "No" << endl;
      return 0;
    }
    bitset<30> bs1, bs2, bs3;
    if (cnt > no_cnt) {
      bs1 = bitset<30>(used[0]);
      bs2 = bitset<30>(used[0]);
      bs3 = bitset<30>(used[1]);
    } else {
      bs1 = bitset<30>(used[0]);
      bs2 = bitset<30>(used[1]);
      bs3 = bitset<30>(used[1]);
    }
    if (bs1 == (bs2 ^ bs3)) {
      if (bs2 == (bs1 ^ bs3)) {
        if (bs3 == (bs1 ^ bs2)) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
    cout << "No" << endl;
    return 0;
  }
  bitset<30> bs1, bs2, bs3;
  bs1 = bitset<30>(used[0]);
  bs2 = bitset<30>(used[1]);
  bs3 = bitset<30>(used[2]);
  if (bs1 == (bs2 ^ bs3)) {
    if (bs2 == (bs1 ^ bs3)) {
      if (bs3 == (bs1 ^ bs2)) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
