#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;
        break;
      }
    }
    if (answer) {
      answer = false;
      if ((count[0] == n & candidate[0] == 0) |
          (count[0] == count[1] & count[1] == count[2])) {
        if ((int)(candidate[0] ^ candidate[1] ^ candidate[2]) == 0) {
          answer = true;
        }
      } else if ((count[1] == n / 3 & count[2] == 0 & candidate[1] == 0) |
                 (count[0] == n / 3 & count[2] == 0 & candidate[0] == 0)) {
        answer = true;
      }
    }
  }
  if (answer)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
