#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0 ? a : gcd(b, a % b));
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int bexp(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = res * a % 998244353;
    }
    a = a * a % 998244353;
    b >>= 1;
  }
  return res % 998244353;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<long long int, long long int> mi;
  long long int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mi[a[i]]++;
  }
  int f = 0;
  if (mi[0] == n) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No\n";
    return 0;
  }
  vector<int> b;
  for (auto e : mi) {
    for (int i = 0; i < e.second / (n / 3); ++i) {
      b.push_back(e.first);
    }
  }
  if (b.size() == 3 && (b[0] ^ b[1] == b[2]))
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
