#include <bits/stdc++.h>
using namespace std;
long long INF = 1e9 + 7;
long long mod = 1e9 + 7;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  map<long long, long long> Mp;
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
    Mp[a[i]]++;
  }
  if (Mp.size() == 1) {
    if (Mp[0] == N) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (Mp.size() == 2) {
    if (N % 2 == 0 && Mp[0] == N / 2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (Mp.size() == 3) {
    long long ok = 0;
    for (pair<long long, long long> p : Mp) {
      ok ^= p.first;
      if (p.second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (ok == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
