#include <bits/stdc++.h>
using namespace std;
int n, in[100005], c2;
map<int, int> cnt;
int main() {
  while (~scanf("%d", &n)) {
    c2 = 0;
    cnt.clear();
    for (int i = 1; i <= n; i++) {
      scanf("%d", &in[i]);
      cnt[in[i]]++;
      if (cnt[in[i]] == 1) c2++;
    }
    auto chk1 = [&]() {
      if (c2 != 3) return false;
      vector<int> tmp;
      for (auto i : cnt)
        if (i.second) {
          if (i.second != n / 3) return false;
          tmp.push_back(i.first);
        }
      if ((tmp[0] ^ tmp[1]) == tmp[2]) return true;
      return false;
    };
    auto chk2 = [&]() {
      if (c2 != 2) return false;
      if (cnt[0] != n / 3) return false;
      for (auto i : cnt)
        if (i.second) {
          if (i.second != n / 3 * 2) return false;
        }
      return true;
    };
    if (cnt[0] == n)
      puts("Yes");
    else if (n % 3 != 0)
      puts("No");
    else if (chk1())
      puts("Yes");
    else if (chk2())
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
