#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> mp;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int i, x;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> x, mp[x]++;
  if (mp.count(0) && mp[0] == n) {
    cout << "Yes\n";
    exit(0);
  };
  if (n % 3) {
    cout << "No\n";
    exit(0);
  };
  if (mp.size() > 3) {
    cout << "No\n";
    exit(0);
  };
  int xr = 0;
  for (auto &it : mp) {
    if (it.second != n / 3 && it.second != 2 * n / 3) {
      cout << "No\n";
      exit(0);
    };
    xr ^= it.first;
  }
  if (mp.size() == 2 && mp[0] != n / 3) {
    cout << "No\n";
    exit(0);
  };
  if (xr) {
    cout << "No\n";
    exit(0);
  };
  {
    cout << "Yes\n";
    exit(0);
  };
  return 0;
}
