#include <bits/stdc++.h>
using namespace std;
int N;
int A[100010];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i <= N; i++) {
    if (N == i) {
      cout << "Yes" << endl;
      return 0;
    }
    if (A[i] != 0) break;
  }
  sort(A, A + N);
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i <= N; i++) {
    if (i == N) {
      cout << "Yes" << endl;
      return 0;
    }
    if (i < N / 3)
      if (A[i] != 0) break;
    if (i >= N / 3 && i != N - 1)
      if (A[i] != A[i + 1]) break;
  }
  for (int i = 0; i <= N; i++) {
    if (i == N && A[0] ^ A[N / 3] == A[N - 1]) {
      cout << "Yes" << endl;
      return 0;
    }
    if (i != 0 && i < N / 3) {
      if (A[i] != A[i - 1]) break;
    }
    if (i != N / 3 && N / 3 <= i && i < N / 3 * 2) {
      if (A[i] != A[i - 1]) break;
    }
    if (i != N / 3 * 2 && N / 3 * 2 <= i && i < N) {
      if (A[i] != A[i - 1]) break;
    }
  }
  cout << "No" << endl;
  return 0;
}
