#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long INF = 1e18;
const long long M = 1e9 + 7;
const long long maxn = 1e5 + 5;
long long a[maxn];
signed main() {
  freopen("in.txt", "r", stdin);
  long long n;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a, a + n);
  if (n % 3 == 0) {
    if ((long long)mp.size() == 1 && a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    if ((long long)mp.size() == 3) {
      bool ok = 1;
      if ((a[0] ^ a[n / 3]) != a[n - 1]) {
        ok = 0;
      }
      for (auto i : mp) {
        if (i.second != n / 3) {
          ok = 0;
        }
      }
      if (ok) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      return 0;
    }
    cout << "No" << endl;
  } else {
    if ((long long)mp.size() == 1 && a[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
