#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
long long int N;
long long int A[100005];
string solve() {
  sort(A, A + N);
  long long int n = 1;
  for (long long int(i) = (1); (i) < (N); ++(i)) {
    if (A[i] != A[i - 1]) n++;
  }
  if (n > 3) return "No";
  if (n == 1) {
    if (A[0] == 0 && A[N - 1] == 0)
      return "Yes";
    else
      return "No";
  }
  if (N % 3 != 0) return "No";
  long long int x = 0;
  long long int f = 1, l = 1;
  for (long long int(i) = (1); (i) < (N); ++(i)) {
    if (A[i] != A[i - 1]) {
      x = A[i];
      break;
    }
    f++;
  }
  for (long long int(i) = (1); (i) < (N); ++(i)) {
    if (A[N - 1 - i] != A[N - i]) break;
    l++;
  }
  if (n == 2) {
    if (A[0] == 0 && l == 2 * f)
      return "Yes";
    else
      return "No";
  }
  if (A[0] ^ A[N - 1] == x && f == l && 3 * f == N) return "No";
  return "No";
}
int main() {
  cin >> N;
  for (long long int(i) = (0); (i) < (N); ++(i)) {
    cin >> A[i];
  }
  cout << solve() << endl;
  return 0;
}
