#include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1000 * 100 + 5;
int a[N];
int p[N];
int FIND(int v) {
  if (p[v] == v) return v;
  p[v] = FIND(p[v]);
  return p[v];
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    p[i] = i;
  }
  sort(a + 1, a + 1 + n);
  if (n <= 10) {
    do {
      bool f = true;
      for (int i = 1; i <= n; i++) {
        if (i == n - 1) {
          int x = a[i];
          int y = a[i + 1];
          int z = a[1];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        } else if (i == n) {
          int x = a[i];
          int y = a[1];
          int z = a[2];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        } else {
          int x = a[i];
          int y = a[i + 1];
          int z = a[i + 2];
          x ^= z;
          if (x != y) {
            f = false;
            break;
          }
        }
      }
      if (f) {
        cout << "Yes" << endl;
        return 0;
      }
    } while (next_permutation(a + 1, a + 1 + n));
    cout << "No" << endl;
    return 0;
  }
  sort(a + 1, a + 1 + n);
  if (n % 3) {
    if (a[1] == 0 && a[n] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 1; i <= n; i++) mp[a[i]]++;
  for (int i = 1; i <= n; i++) {
    if (mp[a[i]] != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
