#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  map<long long, int> z;
  vector<long long> y;
  int c = 0;
  for (int i = 0; i < N; i++) {
    z[a[i]]++;
    if (z[a[i]] == 1 && a[i] != 0) y.push_back(a[i]);
    if (a[i] == 0) c++;
  }
  if (c == N)
    cout << "Yes" << endl;
  else if (N % 3 != 0)
    cout << "No" << endl;
  else if (y.size() == 3 && z[y[0]] == z[y[1]] == z[y[2]] &&
           (y[0] ^ y[1] ^ y[2]) == 0)
    cout << "Yes" << endl;
  else if (c == N / 3 && z[y[0]] == 2 * N / 3)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
