#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int pa = 0;
  int cnt = 0;
  cin >> n;
  vector<long long int> v(n);
  vector<long long int> a;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] == 0) cnt++;
  }
  sort(v.rbegin(), v.rend());
  for (int i = 1; i < n; i++) {
    if (v[i - 1] == 0) continue;
    if (v[i - 1] == v[i]) {
      pa++;
      i++;
      continue;
    } else {
      a.push_back(v[i - 1]);
    }
  }
  if (v[n - 1] != v[n - 2] && v[n - 1] != 0) a.push_back(v[n - 1]);
  if (pa <= cnt && a.size() == 0) {
    cout << "Yes" << endl;
  } else if (a.size() != 3) {
    cout << "No" << endl;
  } else {
    if (a[0] ^ a[1] == a[2] && a[1] ^ a[2] == a[0] && a[0] ^ a[2] == a[1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
