#include <bits/stdc++.h>
using namespace std;
long long N;
long long a[100100];
vector<long long> V;
signed main() {
  cin >> N;
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
    V.push_back(a[i]);
  }
  sort(V.begin(), V.end());
  V.erase(unique(V.begin(), V.end()), V.end());
  if ((long long)V.size() > 3 || (long long)V.size() < 2) {
    printf("No\n");
    return 0;
  }
  V.push_back(V[1]);
  if ((V[0] ^ V[1]) == V[2]) {
    V.pop_back();
    long long b[3] = {0};
    for (long long i = 0; i < N; i++) {
      if (a[i] == V[0]) {
        b[0]++;
      } else if (a[i] == V[1]) {
        b[1]++;
      } else if ((long long)V.size() > 2) {
        if (a[i] == V[2]) {
          b[2]++;
        }
      }
    }
    if ((long long)V.size() > 2) {
      if (b[0] == b[1] && b[1] == b[2]) {
        printf("Yes\n");
        return 0;
      } else {
        printf("No\n");
        return 0;
      }
    } else {
      if (b[0] * 2 == b[1]) {
        printf("Yes\n");
        return 0;
      } else {
        printf("No\n");
        return 0;
      }
    }
  } else {
    printf("No\n");
    return 0;
  }
  return 0;
}
