#include <bits/stdc++.h>
using namespace std;
const int INF = (long long int)(1LL << 30) - 1;
const double INFd = 100000000000.0;
const long long int INFl = (long long int)9223372036854775807;
const int MAX = 10000;
const long long int MOD = (long long int)1e9 + 7;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
int dx[4] = {0, -1, 0, 1}, dy[4] = {-1, 0, 1, 0};
int mdx[4] = {0, 1, 0, -1}, mdy[4] = {-1, 0, 1, 0};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
int n;
int a[100100];
int b[100100];
int a1 = -1, a2 = -1, a3 = -1;
int n1 = 0, n2 = 0, n3 = 0;
int flag = 0;
int main() {
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a1 == -1) {
      a1 = a[i];
      n1++;
    } else if (a1 == a[i]) {
      n1++;
    } else if (a2 == -1) {
      a2 = a[i];
      n2++;
    } else if (a2 == a[i]) {
      n2++;
    } else if (a3 == -1) {
      a3 = a[i];
      n3++;
    } else if (a3 == a[i]) {
      n3++;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (a2 == -1 && a1 == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a2 == -1) {
    cout << "No" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if ((a3 == -1) && ((a1 == 0 && n1 * 2 == n2) || (a2 == 0 && n2 * 2 == n1))) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a3 == -1) {
    cout << "No" << endl;
    return 0;
  }
  if (((n1 == n2) && (n2 == n3)) &&
      ((a1 ^ a2 == a3) || (a1 ^ a3 == a2) || (a2 ^ a3 == a1))) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
