#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  map<long long, int> count;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    count[v[i]]++;
  }
  if (count[0] == n) {
    return !printf("Yes");
  }
  if (n % 3 != 0) return !printf("No");
  vector<long long> res;
  for (int i = 0; i < n; i++) {
    int ele = v[i];
    if (count.count(ele) > 0 && count[ele] != n / 3 &&
        count[ele] != ((2 * n) / 3)) {
      cout << "here we r " << ele << " " << count[ele] << '\n';
      return !printf("No");
    }
    res.push_back(ele);
  }
  if ((res.size() == 3 && (res[0] ^ res[1] ^ res[2]) == 0) &&
      count[res[0]] == count[res[1]] && count[res[1]] == count[res[2]])
    printf("Yes");
  else if (res.size() == 2 &&
           (count[res[0]] == ((2 * n) / 3) || count[res[1]] == ((2 * n) / 3)))
    printf("Yes");
  else
    printf("No");
  return 0;
}
