#include <bits/stdc++.h>
using namespace std;
int N;
long long a[100001];
long long b[100001];
long long c[100001];
int main() {
  cin >> N;
  map<long long, int> m;
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  int cc = 0;
  for (auto it : m) {
    b[cc] = it.first;
    c[cc] = it.second;
    cc++;
  }
  if (cc == 1) {
    if (b[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (cc == 2) {
    if (b[0] == 0 && c[0] == N / 3 && N % 3 == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (cc == 3) {
    if (c[0] == N / 3 && N % 3 == 0 && c[1] == N / 3 && b[0] ^ b[1] == b[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
