#include <bits/stdc++.h>
void RI() {}
template <typename... T>
void RI(int& head, T&... tail) {
  scanf("%d", &head);
  RI(tail...);
}
using namespace std;
int arr[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  vector<pair<int, int> > v;
  for (int i = 0; i < n;) {
    int j = i + 1;
    while (j < n && arr[j] == arr[i]) j++;
    v.push_back(make_pair(arr[i], j - i));
    i = j;
  }
  bool ans = false;
  int len = v.size();
  if (len == 1 && v[0].first == 0)
    ans = true;
  else if (len == 2 && n % 3 == 0 && v[0].first == 0 &&
           v[0].second * 2 == v[1].second)
    ans = true;
  else if (len == 3 && n % 3 == 0 && v[0].first ^ v[1].first == v[2].first &&
           v[0].second == v[1].second && v[1].second == v[2].second)
    ans = true;
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
