#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

int main() {
  uint32_t N, *a;
  cin >> N;

  a = new uint32_t[N];
  for (uint32_t i = 0; i < N; i++) cin >> a[i];
  uint64_t sum = 0;
  for (uint32_t i = 0; i < N; i++) {
    sum += a[i];
  }
  if (a[i] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
  } else {
    uint32_t A = a[0];
    uint32_t i = 1;
    while (a[i] == A && i < N) ++i;
    if (A == a[i]) {
      cout << "No" << endl;
      return 0;
    }
    uint32_t B = a[i];
    uint32_t C = A ^ B;
    uint32_t ANum = 0, BNum = 0, CNum = 0;
    for (i = 0; i < N; ++i) {
      if (a[i] == A) ANum++;
      if (a[i] == B) BNum++;
      if (a[i] == C) CNum++;
    }
    if (A == 0 || B == 0) {
      if (A == 0) {
        if (BNum == 2 * ANum)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else {
        if (ANum == 2 * BNum)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    } else {
      if (ANum == BNum && ANum == CNum)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
