#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long MOD = 1e9 + 7;
const long long INF = 1LL << 60;
int main() {
  long long n;
  cin >> n;
  set<long long> se;
  map<long long, long long> ma;
  long long a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    se.insert(a);
    ma[a]++;
  }
  if (n % 3 != 0) {
    if (se.size() == 1 && a == 0)
      puts("Yes");
    else
      puts("No");
  } else if (se.size() == 2) {
    for (auto s : se) {
      if (s == 0) {
        if (ma[0] == 2 * n / 3) {
          puts("Yes");
          return 0;
        } else {
          puts("No");
          return 0;
        }
      }
    }
  } else if (se.size() == 3) {
    vector<long long> v;
    for (auto s : se) {
      if (ma[s] != n / 3) {
        puts("No");
        return 0;
      }
      v.push_back(s);
    }
    if (v[0] ^ v[1] == v[2])
      puts("Yes");
    else
      puts("No");
  } else
    puts("No");
  return 0;
}
