#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool answer = true;
  int a[n];
  int candidate[3] = {-1, -1, -1};
  int count[3] = {0, 0, 0};
  if (n % 3 != 0) {
    answer = false;
  } else {
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      if (candidate[0] == -1) {
        candidate[0] = a[i];
        count[0]++;
      } else if (candidate[0] == a[i]) {
        count[0]++;
      } else if (candidate[1] == -1) {
        candidate[1] = a[i];
        count[1]++;
      } else if (candidate[1] == a[i]) {
        count[1]++;
      } else if (candidate[2] == -1) {
        candidate[2] = a[i];
        count[2]++;
      } else if (candidate[2] == a[i]) {
        count[2]++;
      } else {
        answer = false;
      }
    }
    if (answer & count[0] == count[1] & count[1] == count[2]) {
      if ((int)(candidate[0] ^ candidate[1] ^ candidate[2]) != 0) {
        answer = false;
      }
    } else {
      answer = false;
    }
  }
  if (answer)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
