#include <bits/stdc++.h>
using namespace std;
map<int, int> mm;
int main() {
  int n;
  scanf("%d", &n);
  int a;
  for (int i = 1; i < n + 1; i++) scanf("%d", &a), mm[a]++;
  if (n % 3) {
    if (mm.size() == 1 && mm.begin()->first == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    vector<pair<int, int> > v;
    for (auto xx : mm) v.push_back({xx.first, xx.second});
    if (mm.size() == 3 && v[0].second == v[1].second &&
        v[1].second == v[2].second) {
      int k1 = v[0].first, k2 = v[1].first, k3 = v[2].first;
      if (k1 ^ k2 == k3 && k1 ^ k3 == k2 && k2 ^ k3 == k1)
        printf("Yes\n");
      else
        printf("No\n");
    } else
      printf("No\n");
  }
}
