#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
int main() {
  int t = 1;
  int ans = 1;
  long long a = 0, b = 0, c = 0;
  int numa = 0, numb = 0, numc = 0, num0 = 0;
  long long n;
  long long num = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num != 0) {
      t = 0;
    }
    if (num == 0) {
      num0++;
    }
    if (num == a) {
      numa++;
    } else if (num == b) {
      numb++;
    } else if (num == c) {
      numc++;
    } else if (a == 0) {
      a = num;
      numa++;
    } else if (b == 0) {
      b = num;
      numb++;
    } else if (c == 0) {
      c = num;
      numc++;
    } else {
      ans = 0;
    }
  }
  if (n % 3 == 0 && num0 + numa == n) {
    cout << "Yes" << endl;
  }
  if (t == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  if (numa == numb && numb == numc && numa + numb + numc == n)
    ;
  else
    ans = 0;
  if ((a ^ c) == b && (c ^ b) == a && (a ^ b) == c)
    ;
  else
    ans = 0;
  if (ans == 1) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
