#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (mp.find(x) == mp.end()) mp[x] = 0;
    mp[x]++;
  }
  vector<PII> v;
  for (auto p : mp) {
    v.push_back(p);
  }
  sort(v.begin(), v.end());
  if (mp.find(0) == mp.end()) {
    if (mp.size() != 3)
      cout << "No\n";
    else if ((v[0].first ^ v[1].first) != v[2].first)
      cout << "No\n";
    else if (v[0].second != v[1].second || v[0].second != v[2].second)
      cout << "No\n";
    else
      cout << "Yes\n";
  } else {
    if (mp.size() == 2) {
      if (v[1].second % 2 != 0 || (v[0].second < v[1].second / 2))
        cout << "No\n";
      else
        cout << "Yes\n";
    } else
      cout << "No\n";
  }
  return 0;
}
