#include <bits/stdc++.h>
using namespace std;
int main() {
  string ans = "Yes";
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (n % 3 && a) ans = "No";
    mp[a]++;
  }
  if ((n % 3) == 0 && mp[0] != n) {
    int x;
    if (!(mp.size() == 2 && mp[0] == n / 3)) {
      for (auto ite = mp.begin(); ite != mp.end(); ++ite) {
        if (ite->second != n / 3) ans = "No";
        if (ite == mp.begin())
          x = ite->first;
        else
          x = x ^ ite->first;
      }
      if (x) ans = "No";
    }
  }
  cout << ans << endl;
  return 0;
}
