#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  int z = 0;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
    if (a[i] != 0) z = 1;
  }
  if (z == 0) {
    cout << "Yes";
    return 0;
  }
  if (n % 3 != 0 || m.size() != 3) {
    cout << "No";
    return 0;
  }
  int b[3];
  int l = 0;
  for (auto x : m) {
    if (x.second != n / 3) {
      cout << "No";
      return 0;
    }
    b[l++] = x.first;
  }
  if (a[0] != a[1] ^ a[2] || a[1] != a[0] ^ a[2] || a[2] != a[1] ^ a[0])
    cout << "No";
  else
    cout << "Yes";
}
