#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  long long a[N];
  map<long long, int> m;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    if (m.find(a[i]) == m.end()) ++m[a[i]];
  }
  if (m.find(0) != m.end() && m[0] == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 2 && m.find(0) != m.end() && m[0] == N / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  if (m.size() == 3) {
    int j = 0;
    long long x[3];
    for (map<long long, int>::iterator i = m.begin(); i != m.end(); ++i) {
      if (i->second != N / 3) {
        cout << "No" << endl;
      }
      x[j++] = i->first;
    }
    if (x[0] ^ x[1] ^ x[2] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
