#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int a[n];
  map<int, int> c;
  int M = 0;
  int b[3];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
    if (M < a[i]) {
      M = a[i];
    }
    if (c[a[i]] == 1) {
      if (b[0] == 0) {
        b[0] = a[i];
      } else if (b[1] == 0) {
        b[1] = a[i];
      } else if (b[2] == 0) {
        b[2] = a[i];
      }
    }
  }
  bool flg = true;
  for (int i = 1; i <= 3; i++) {
    if (b[i] == n / 3) {
    } else {
      flg = false;
    }
  }
  if ((n % 3 != 0) || !flg) {
    cout << "No";
  } else if (b[0] ^ b[1] == b[2] || b[0] ^ b[2] == b[1] ||
             b[2] ^ b[1] == b[0] || c[0] == n) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
