#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;
  if (n % 3 == 0 && count[0] == n / 3) {
    for (auto ele : count) {
      if (count[ele.first] != n / 3 && count[ele.first] != ((2 * n) / 3)) {
        return !printf("No");
      }
      res.push_back(ele.first);
    }
  }
  if ((res.size() == 3 && res[0] ^ res[1] ^ res[2] == 0))
    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;
}
