#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0, i_len = (N); i < i_len; ++i) cin >> a[i];
  set<long long> s;
  for (long long i = 0, i_len = (N); i < i_len; ++i) s.insert(a[i]);
  bool ans = true;
  if (s.size() == 1 && a[0] == 0) {
    puts("Yes\n");
    return 0;
  }
  if (N % 3 == 0) {
    sort(a.begin(), a.end());
    if (s.size() > 3) {
      ans = false;
      puts("No\n");
      return 0;
    }
    if (s.size() == 3) {
      vector<long long> v(s.begin(), s.end());
      long long c[3] = {0, 0, 0};
      for (long long i = 0, i_len = (N); i < i_len; ++i) {
        if (a[i] == v[0]) c[0]++;
        if (a[i] == v[1]) c[1]++;
        if (a[i] == v[2]) c[2]++;
      }
      if (c[0] != c[1] || c[1] != c[2]) {
        ans = false;
        puts("No\n");
        return 0;
      }
      if ((v[0] == (v[1] ^ v[2])) && (v[1] == (v[2] ^ v[0])) &&
          (v[2] == (v[0] ^ v[1])))
        ans = true;
      else
        ans = false;
    } else {
      vector<long long> v(s.begin(), s.end());
      long long c[2] = {0, 0};
      for (long long i = 0, i_len = (N); i < i_len; ++i) {
        if (a[i] == v[0]) c[0]++;
        if (a[i] == v[1]) c[1]++;
      }
      if (c[0] != c[1] * 2 && c[1] != c[0] * 2) {
        ans = false;
        puts("No\n");
        return 0;
      }
      assert(false);
    }
  } else {
    ans = false;
  }
  if (ans)
    puts("Yes\n");
  else
    puts("No\n");
  return 0;
}
