#include <bits/stdc++.h>
using namespace std;
int ex(int a, int b) {
  int ans[40];
  for (int i = 0; i < 40; i++) {
    int p = a % 2;
    int q = b % 2;
    ans[i] = (p + q) % 2;
    p /= 2;
    q /= 2;
  }
  int an = 0;
  for (int i = 39; i >= 0; i--) {
    an *= 2;
    an += ans[i];
  }
  return an;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a.begin(), a.end());
  if (a[N - 1] == 0) cout << "Yes" << endl;
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  N /= 3;
  for (int i = 0; i < 3; i++) {
    if (a[i * N] != a[(i + 1) * N - 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  int t = ex(a[0], a[N]);
  t = ex(t, a[N * 2]);
  if (t)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
