#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;
  int t = mp.begin()->second;
  for (auto &i : mp)
    if (i.second == t) a.push_back(i.first);
  if (mp.size() == 3 && a.size() == 3 && (a[0] ^ a[1]) == a[2])
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
