#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  map<int, int> b;
  for (int i = 0; i < N; i++) b[a[i]]++;
  if (b.size() == 3) {
    int A[3], B[3];
    for (int i = 0; i < 3; i++) {
      auto itr = b.begin();
      for (int j = 0; j < i; j++) itr++;
      auto tmp = *itr;
      A[i] = tmp.first;
      B[i] = tmp.second;
    }
    if ((A[0] ^ A[2]) == A[1] || (A[0] ^ A[1]) == A[2]) {
      if (B[0] == B[1] && B[1] == B[2]) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else if (b.size() == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
