#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> m;
  int zero = 0;
  for (int i = 0; i < (int)(N); i++) {
    cin >> a[i];
    if (a[i] == 0) {
      zero++;
    }
  }
  sort((a).begin(), (a).end());
  int ans = 0;
  if (N == 3) {
    if (a[0] ^ a[1] == a[2]) {
      ans = 1;
    }
  } else {
    if (zero == N) {
      ans == 1;
    } else if (N % 3 == 0) {
      ans = 1;
      for (int i = 0; i < (int)(N / 3); i++) {
        if (a[i] ^ a[i + N / 3] != a[i + N / 3 * 2]) {
          ans = 0;
          break;
        }
      }
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
