#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    mp[x]++;
  }
  if (mp.size() > 3 || n % 3) {
    cout << "No";
  } else {
    if (mp.size() == 1) {
      if (mp[0] == n) {
        cout << "Yes";
        return 0;
      }
    } else if (mp.size() == 2) {
      if (mp[0] == n / 3) {
        cout << "Yes";
        return 0;
      }
    } else {
      long long x = 0;
      for (auto i : mp) {
        x ^= i.first;
        if (i.second != n / 3) {
          cout << "No";
          return 0;
        }
      }
      if (x == 0) {
        cout << "Yes";
        return 0;
      }
    }
    cout << "No";
  }
  return 0;
}
