#include <bits/stdc++.h>
using namespace std;
long long p[3];
long long g[3];
int main() {
  long long n;
  long long c = 0;
  int t = 1;
  int l;
  cin >> n;
  long long a[100007];
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  p[0] = a[0];
  for (int i = 0; i < (n - 1); i++) {
    l = 0;
    for (int j = 0; j < (t); j++) {
      if (a[i + 1] != p[j]) {
        l++;
      } else {
        g[j]++;
      }
    }
    if (l == t) {
      p[t] = a[i + 1];
      t++;
    }
    if (t == 4) {
      c++;
      break;
    }
  }
  if (t == 1) {
    if (a[0] != 0) {
      c++;
    }
  }
  if (t == 2) {
    c++;
  }
  if (t == 3) {
    if (p[0] != (p[1] xor p[2]) || g[0] != g[1] || g[1] != g[2] ||
        g[2] != g[0]) {
      c++;
    }
  }
  if (c == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
