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