#include <bits/stdc++.h>
using namespace std;
const long long LLINF = (1LL << 60);
const long long INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const long long MOD = 1000000007;
long long N;
vector<long long> A;
map<long long, long long> A_map;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  A.resize(N);
  for (long long i = 0; i < N; ++i) {
    cin >> A[i];
    A_map[A[i]]++;
  }
  if (A_map.size() == 3) {
    vector<long long> val(3);
    long long j = 0;
    for (auto& a_tmp : A_map) {
      if (a_tmp.second != N / 3) {
        printf("No\n");
        return 0;
      }
      val[j] = a_tmp.first;
      j++;
    }
    if (val[0] == (val[1] ^ val[2]) && val[1] == (val[0] ^ val[2]) &&
        val[2] == (val[1] ^ val[0])) {
      printf("Yes\n");
      return 0;
    }
  } else if (A_map.size() == 2) {
    assert(false);
  } else if (A_map.size() == 1) {
    for (auto& a_tmp : A_map) {
      if (a_tmp.first != 0) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
