#include <bits/stdc++.h>
using namespace std;
int n, a[100100], b[11];
map<int, int> mp;
int main() {
  cin >> n;
  int t = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), t |= a[i];
  if (t == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) mp[a[i]]++;
  if (mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  int tot = 0;
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++)
    if (it->second % (n / 3) != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      b[++tot] = it->first;
      if (it->second == n / 3 * 2) b[++tot] = it->first;
      if (it->second == n) b[++tot] = it->first;
    }
  if ((b[1] ^ b[3]) == b[2] && (b[2] ^ b[3]) == b[1] && (b[1] ^ b[2]) == b[3])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
