#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
long long A, B, C, D, N, L, K, P, Q, R, W, X, Y, Z;
string S, T;
signed main() {
  std::cin >> N;
  int a[N];
  int flag = 0;
  if (N % 3 != 0)
    std::cout << "No" << std::endl;
  else {
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      std::cin >> a[i];
    }
    sort(a, a + N);
    A = a[0];
    B = a[N / 3];
    C = a[N * 2 / 3];
    for (int i = 0, i_len = (N / 3); i < i_len; ++i) {
      if (a[i] != A) flag++;
    }
    for (int i = N / 3; i < N * 2 / 3; i++) {
      if (a[i] != B) flag++;
    }
    for (int i = N * 2 / 3; i < N; i++) {
      if (a[i] != C) flag++;
    }
    if ((A ^ B) == C && flag == 0)
      std::cout << "Yes" << std::endl;
    else
      std::cout << "No" << std::endl;
  }
}
