#include <bits/stdc++.h>
using namespace std;
int a[200005], tmp[200004], num[200005];
map<int, int> vis;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", a + i);
    if (!vis[a[i]]) vis[a[i]] = ++cnt;
    num[cnt]++;
    tmp[cnt] = a[i];
  }
  bool ok = true;
  if (cnt != 3 || ((tmp[1] ^ tmp[2]) ^ tmp[3]) != 0) ok = false;
  if (num[1] != n / 3 || num[2] != n / 3 || num[3] != n / 3 || n % 3)
    ok = false;
  if (cnt == 1 && tmp[1] == 0) ok = true;
  puts(ok ? "Yes" : "No");
  return 0;
}
