#include <bits/stdc++.h>
using namespace std;
int n;
void solve() {
  cin >> n;
  map<int, int> f;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int first;
    cin >> first;
    f[first]++;
    s.insert(first);
  }
  vector<int> v((s).begin(), (s).end());
  if ((int)f.size() == 3 and f[v[0]] == f[v[1]] and f[v[1]] == f[v[2]] and
      (v[0] ^ v[1]) == v[2])
    cout << "Yes" << '\n';
  else if ((int)f.size() == 2 and v[0] == 0 and 2 * f[v[0]] == f[v[1]])
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
