#include <bits/stdc++.h>
using namespace std;
long long n, A[100005];
bool checkAll0() {
  for (long long i = 1; i <= n; i++)
    if (A[i] != 0) return 0;
  return 1;
}
bool checkValid() {
  long long a = A[1], b = A[n / 3 + 1], c = (n / 3 * 2 + 1);
  for (long long i = 1; i <= n / 3; i++)
    if (A[i] != A[1]) return 0;
  for (long long i = n / 3 + 1; i <= n / 3 * 2; i++)
    if (A[i] != A[n / 3 + 1]) return 0;
  for (long long i = n / 3 * 2 + 1; i <= n; i++)
    if (A[i] != A[n / 3 * 2 + 1]) return 0;
  return 1;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> A[i];
  if (n % 3 != 0) {
    if (checkAll0())
      cout << "Yes";
    else
      cout << "No";
  } else {
    sort(A + 1, A + n + 1);
    long long a = A[1], b = A[n / 3 + 1], c = (n / 3 * 2 + 1);
    if (!checkValid()) {
      cout << "No";
      return 0;
    }
    if (a ^ c == b)
      cout << "Yes";
    else
      cout << "No";
  }
}
