#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  long long N;
  cin >> N;
  int flag2 = 0;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (A[i] == 0) {
      flag2 = 1;
    }
  }
  map<long long, int> mp;
  for (int i = 0; i < N; i++) {
    mp[A[i]]++;
  }
  int flag = 0;
  if (flag2 == 1) {
    if (mp.size() == 1) {
      flag = 1;
    } else if (mp.size() == 2) {
      int y = mp[0];
      for (auto x : mp) {
        if (x.first != 0 && x.second % (y * 2) == 0) {
          flag = 1;
        }
      }
    }
  } else {
    if (mp.size() == 3) {
      vector<P> pr(3);
      int i = 0;
      for (auto x : mp) {
        pr.at(i).first = x.first;
        pr.at(i).second = x.second;
        i++;
      }
      if (pr.at(0).second == pr.at(1).second ||
          pr.at(0).second == pr.at(2).second) {
        if (pr.at(0).first ^ pr.at(1).first == pr.at(2).first) {
          flag = 1;
        }
      }
    }
  }
  if (flag == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
