#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  int n;
  cin >> n;
  int a[n];
  map<int, int> mp;
  bool all0 = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) all0 = false;
    mp[a[i]]++;
  }
  if (n % 3 == 0) {
    if (mp.size() != 3) {
      cout << "No" << endl;
      return 0;
    }
    for (auto i : mp) {
      if (i.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    int x[3];
    int cnt = 0;
    for (auto i : mp) {
      x[cnt] = i.first;
      cnt++;
    }
    if ((x[0] ^ x[1]) != x[2]) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (all0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
