#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MOD2 = 998244353;
long long a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  bool f = 1;
  if (n % 3 != 0)
    f = 0;
  else {
    map<long long, int> mp;
    for (int i = 0; i < n; i++) mp[a[i]]++;
    if (mp.size() != 3)
      f = 0;
    else {
      vector<long long> tmp;
      for (auto v : mp) {
        if (v.second != n / 3) f = 0;
        tmp.push_back(v.first);
      }
      long long x = tmp[0] ^ tmp[1] ^ tmp[2];
      if (x != 0) f = 0;
    }
  }
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
