#include <bits/stdc++.h>
using namespace std;
int n, ans;
map<int, int> m;
int main() {
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  ans = a[0] ^ a[1];
  ans = ans ^ a[2];
  if (a.size() == 2 && a[0] == 0 && m[0] == n / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a.size() == 3 && ans == 0 && m[a[0]] == m[a[1]] && m[a[1]] == m[a[2]])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
