#include <bits/stdc++.h>
using namespace std;
int len;
map<int, int> mp;
bool check() {
  if (mp[0] == len) return true;
  if (len != 3 && (len & 1)) return false;
  if (mp.size() > 3) return false;
  if (mp.size() == 3) {
    auto it1 = mp.begin(), it2 = next(mp.begin()), it3 = prev(mp.end());
    if (it1->second == it2->second && it2->second == it3->second) {
      int fst = it1->first, snd = it2->first, thd = it3->first;
      return ((fst ^ snd) == thd || (fst ^ thd) == snd || (snd ^ thd) == fst);
    }
    return false;
  }
  if (mp.size() == 2) {
    auto it1 = mp.begin(), it2 = next(mp.begin());
    return (it1->first == 0 && it2->second == it1->second * 2);
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> len;
  for (int i = 0; i < len; i++) {
    int cnt;
    cin >> cnt;
    mp[cnt]++;
  }
  cout << (check() ? "Yes\n" : "No\n");
  return 0;
}
