#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> count;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    count[a]++;
  }
  string ans;
  if (count.size() > 3)
    ans = "No";
  else if (count.size() == 3) {
    auto it = count.begin();
    if (it->second == next(it)->second && it->second == next(it, 2)->second &&
        (it->first ^ next(it)->first) == next(it, 2)->first)
      ans = "Yes";
    else
      ans = "No";
  } else if (count.size() == 2) {
    auto it = count.begin();
    if ((it->second * 2 == next(it)->second &&
         (it->first ^ it->first) == next(it)->first) ||
        (it->second == next(it)->second * 2 &&
         (it->first ^ next(it)->first) == next(it)->first))
      ans = "Yes";
    else
      ans = "No";
  } else if (count.size() == 1) {
    auto it = count.begin();
    if (it->first == 0)
      ans = "Yes";
    else
      ans = "No";
  }
  cout << ans << endl;
}
