#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  scanf("%i", &n);
  map<int, int> cnt;
  for (int i = 1; i <= n; i++) scanf("%i", &x), cnt[x]++;
  if (cnt.size() <= 3) {
    vector<int> sz, v;
    for (auto it = cnt.begin(); it != cnt.end(); it++) {
      auto p = *it;
      v.push_back(p.first);
      sz.push_back(p.second);
    }
    if (cnt.size() == 3) {
      if (sz[0] == sz[1] && sz[1] == sz[2] && v[0] ^ v[1] == v[2])
        printf("Yes\n");
      else
        printf("No\n");
    } else if (cnt.size() == 2) {
      if (v[0] == 0 && sz[0] * 2 == sz[1])
        printf("Yes\n");
      else
        printf("No\n");
    } else if (cnt.size() == 1) {
      if (v[0] == 0)
        printf("Yes\n");
      else
        printf("No\n");
    }
  } else
    printf("No\n");
  return 0;
}
