#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  vector<int> v;
  int tmp = 1;
  for (int i = 1; i < N; i++) {
    if (a[i - 1] != a[i]) {
      v.push_back(tmp);
      tmp = 1;
    } else
      tmp++;
  }
  v.push_back(tmp);
  if (v.size() > 3)
    cout << "No";
  else if (v.size() == 3 && N % 3 == 0) {
    if (v[0] ^ v[1] == v[2]) {
      cout << "Yes";
    }
  } else if (v.size() == 2 && N % 3 == 0 && v[0] == N / 3)
    cout << "Yes";
  else if (v.size() == 1 && v[0] == 0)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
