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