#include <bits/stdc++.h>
using namespace std;
void solve(long long N, std::vector<long long> a) {
  sort(a.begin(), a.end());
  vector<long long> ac(3, 0);
  vector<long long> ab(3, 0);
  int j = 0;
  long long t;
  if (a[0] == 0) {
    t = a[0];
    for (int i = 0; i < N; i++) {
      if (a[i] == t) {
        ac[j]++;
      } else {
        t = a[i];
        j++;
        if (j >= 2) {
          std::cout << "No" << std::endl;
          return;
        }
        ac[j]++;
      }
    }
    if (ac[0] * 2 == ac[1]) {
      std::cout << "Yes" << std::endl;
    } else {
      std::cout << "No" << std::endl;
    }
  } else {
    t = a[0];
    ab[0] = t;
    for (int i = 0; i < N; i++) {
      if (a[i] == t) {
        ac[j]++;
      } else {
        t = a[i];
        j++;
        if (j >= 3) {
          std::cout << "No" << std::endl;
          return;
        }
        ac[j]++;
        ab[j] = t;
      }
    }
    if (ac[0] == ac[1] && ac[1] == ac[2] && (ab[0] ^ ab[1] == ab[2])) {
      std::cout << "Yes" << std::endl;
    } else {
      std::cout << "No" << std::endl;
    }
  }
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, std::move(a));
  return 0;
}
