#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const int INF = 1001001001;
const int MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); ++i) cin >> a[i];
  bool ans = true;
  for (int i = 0; i < (N); ++i) {
    if (a[i] != 0) ans = false;
  }
  if (ans) {
    puts("Yes");
    return 0;
  }
  if (N % 3 != 0) {
    puts("No");
    return 0;
  }
  map<int, int> m;
  for (int i = 0; i < (N); ++i) {
    m[a[i]]++;
  }
  if (m.size() != 3) {
    puts("No");
    return 0;
  }
  vector<int> v;
  for (auto j : m) {
    v.push_back(j.first);
  }
  int x = v[0] ^ v[1] ^ v[2];
  if (x != 0) {
    puts("No");
    return 0;
  }
  ans = true;
  for (auto i : m) {
    if (i.second != N / 3) ans = false;
  }
  if (ans) {
    puts("Yes");
  } else {
    puts("No");
  }
}
