#include <bits/stdc++.h>
using namespace std;
map<int, int> C;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  sort(A.begin(), A.end());
  for (auto i : A) ++C[i];
  A.erase(unique(A.begin(), A.end()), A.end());
  if (A.size() > 3)
    printf("No");
  else if (A.size() == 3) {
    if ((A[0] ^ A[1]) == A[2] &&
        max({C[A[0]], C[A[1]], C[A[2]]}) - min({C[A[0]], C[A[1]], C[A[2]]}) < 2)
      printf("Yes");
    else
      printf("No");
  } else {
    if (A[0])
      printf("No");
    else {
      if (A.size() == 2 && abs(C[A[0]] - C[A[1]]) > 1)
        printf("No");
      else
        printf("Yes");
    }
  }
  return 0;
}
