#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, long long> mp;
  vector<long long> r;
  for (int(i) = 0; (i) < (N); (i)++) {
    long long b;
    cin >> b;
    mp[b]++;
    if (mp[b] == 1) r.push_back(b);
  }
  sort((r).begin(), (r).end());
  if (mp.size() > 3) {
    cout << "No" << endl;
  } else if (mp.size() == 1) {
    if (r[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp.size() == 2) {
    if (r[0] == 0 && 2 * mp[r[0]] == mp[r[1]])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp.size() == 3) {
    if (r[0] ^ r[1] == r[2] && (mp[r[0]] == mp[r[1]] && mp[r[1]] == mp[r[2]]))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
