#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  long long a[100000];
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  long long unique = 0;
  long long table[3];
  long long size[3];
  long long prev = -1;
  for (int i = 0; i < N; i++) {
    if (prev != a[i]) {
      prev = a[i];
      if (unique == 3) {
        cout << "No" << endl;
        return 0;
      }
      table[unique] = prev;
      unique++;
    }
    size[unique - 1]++;
  }
  if (unique == 3) {
    if (table[0] == 0) {
      cout << "No" << endl;
      return 0;
    }
    if (N % 3 == 0 && size[0] == size[1] && size[1] == size[2] &&
        table[0] ^ table[1] ^ table[2] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (unique == 2) {
    if (table[0] != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (N % 3 == 0 && size[0] * 2 == size[1]) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (unique == 1) {
    if (table[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
