#include <bits/stdc++.h>
using namespace std;
const long long INF = 1 << 30;
const long long N = 1e6;
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC optimize("O4")
#pragma GCC optimize("O5")
#pragma GCC optimize("O6")
#pragma GCC optimize("O7")
#pragma GCC optimize("O8")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
long long n;
vector<long long> v;
set<long long> s1;
map<long long, long long> m;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long t0 = 0;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x == 0) t0 = 1;
    if (m[x] == 0) {
      v.push_back(x);
      m[x]++;
    }
    s1.insert(x);
  }
  sort(v.begin(), v.end());
  if (t0 == 1) {
    if (s1.size() == 1)
      return cout << "Yes", 0;
    else
      return cout << "No", 0;
  }
  if (n % 3 == 1 || n % 3 == 2) {
    return cout << "No", 0;
  }
  if (s1.size() > 3) return cout << "No", 0;
  if (s1.size() == 3) {
    if (v[0] ^ v[1] == v[2] && m[v[0]] == (n / 3) && m[v[1]] == (n / 3) &&
        m[v[2]] == (n / 3))
      return cout << "Yes", 0;
    else
      return cout << "No", 0;
  } else
    return cout << "No", 0;
  return 0;
}
