#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A.begin(), A.end());
  A.push_back(A[0]);
  bool can = true;
  for (int i = 1; i < N; i++) {
    if (A[i] != (A[i - 1] ^ A[i + 1])) can = false;
  }
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    mp[A[i]]++;
  }
  int s = mp.size();
  if (s == 1) {
    if (mp[0] == N) can = true;
  } else if (s == 2) {
    int a = 0;
    for (auto& x : mp) {
      if (x.first == 0) {
        if (x.second == N / 3) a++;
      } else {
        if (x.second == N / 3 * 2) a++;
      }
    }
    if (a == 2) can = true;
  }
  if (can)
    cout << "Yes\n";
  else
    cout << "No\n";
}
