#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> cnt;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    cnt[x]++;
  }
  if (n % 3) {
    puts("No");
  } else {
    if (cnt.size() == 1) {
      puts(cnt.begin()->first == 0 ? "Yes" : "No");
    } else if (cnt.size() == 2) {
      vector<int> a;
      bool found = false;
      for (auto& it : cnt) {
        if (!((it.second == n / 3 && it.first == 0) ||
              (it.second == n / 3 * 2 && it.first != 0)))
          found = true;
      }
      puts(found ? "No" : "Yes");
    } else if (cnt.size() == 3) {
      bool found = false;
      vector<int> a;
      for (auto& it : cnt) {
        if (it.second != n / 3) found = true;
        a.push_back(it.first);
      }
      if ((a[0] ^ a[1]) != a[2]) found = true;
      puts(found ? "No" : "Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
