#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  bool ans = false;
  if (n % 3 == 0) {
    int x, y, z;
    ans = true;
    sort(a, a + n);
    for (int i = 0; i < n / 3 - 1; i++) {
      if (a[i] != a[i + 1]) ans = false;
      x = a[i];
    }
    for (int i = n / 3; i < 2 * n / 3 - 1; i++) {
      if (a[i] != a[i + 1]) ans = false;
      y = a[i];
    }
    for (int i = 2 * n / 3; i < n - 1; i++) {
      if (a[i] != a[i + 1]) ans = false;
      z = a[i];
    }
    if ((x ^ y) != z) ans = false;
  }
  cout << (ans ? "Yes" : "No") << endl;
}
