#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = (0); i < (n); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  if (a[n - 1] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long N = n / 3;
  if (a[0] == 0 && a[0] == a[N - 1] && a[N] == a[3 * N - 1])
    cout << "Yes" << endl;
  if (a[0] == a[N - 1] && a[N] == a[2 * N - 1] && a[2 * N] == a[3 * N - 1]) {
    if ((a[0] ^ a[N] ^ a[2 * N]) == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
}
