#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    ++mp[x];
  }
  vector<int> a;
  vector<pair<int, int>> b;
  int t = mp.begin()->second;
  for (auto &i : mp) {
    if (i.second == t) a.push_back(i.first);
    b.push_back({i.second, i.first});
  }
  sort(b.begin(), b.end());
  if ((mp.size() == 3 && a.size() == 3 && (a[0] ^ a[1]) == a[2]) ||
      (mp.size() == 2 && b[0].first * 2 == b[1].first &&
       (!b[0].second || !b[1].second)))
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
