#include <bits/stdc++.h>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
int main() {
  long long N;
  cin >> N;
  long long i, j, k, l;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  long long sum = 0;
  for (int i = 0; i < N; i++) sum += a[i];
  bool judge = false;
  long long cnt = 0;
  vector<long long> b(3);
  for (int i = 0; i < N; i++) {
    if (a[i] != b[0] and a[i] != b[0] and a[i] != b[0]) {
      cnt++;
      if (b[0] == 0)
        b[0] = a[i];
      else if (b[1] == 0)
        b[1] = a[i];
      else
        b[2] = a[i];
    } else
      continue;
  }
  long long s = (b[0] ^ b[1]) ^ b[2];
  if (cnt == 0)
    judge = true;
  else if (cnt == 1 and N % 3 == 0 and sum == b[0] * 2 * N / 3)
    judge = true;
  else if (cnt == 3 and s == 0)
    judge = true;
  if (judge)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
