#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c;
  map<int, int> mp;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c);
    mp[c]++;
  }
  if (n % 3 != 0) {
    if (mp.size() > 1 || mp.find(0) == mp.end())
      cout << "No\n";
    else
      cout << "Yes\n";
    return 0;
  }
  vector<int> val;
  for (auto i : mp) {
    if (i.second % (n / 3) != 0) {
      cout << "No\n";
      return 0;
    }
    while (i.second) val.push_back(i.first), i.second -= n / 3;
  }
  if (val[0] ^ val[1] == val[2] && val[1] ^ val[2] == val[0] &&
      val[2] ^ val[0] == val[1])
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
