#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  set<int> s;
  map<int, int> mp;
  bool ans;
  cin >> N;
  for (int i = 0; i < (N); i++) {
    int a;
    cin >> a;
    s.insert(a);
    if (mp.count(a) != 0)
      mp[a]++;
    else
      mp[a] = 1;
  }
  if (s.size() != 3)
    ans = false;
  else {
    set<int>::iterator it = s.begin();
    int x = *it;
    it++;
    int y = *it;
    it++;
    int z = *it;
    if ((x ^ y) == z) {
      if (max(mp[x], max(mp[y], mp[z])) - min(mp[x], min(mp[y], mp[z])) <= 1) {
        ans = true;
      } else
        ans = false;
    } else
      ans = false;
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
