#include <bits/stdc++.h>
using namespace std;
const int INTINF = int(1e9) + 1;
const long long LLINF = long long(1e18) + 1;
long double eps = 1.0E-14;
void solve() {
  int N;
  cin >> N;
  map<int, int> mp;
  set<int> s;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    int a;
    cin >> a;
    mp[a]++;
    s.insert(a);
  }
  if (mp.count(0) and mp[0] == N) {
    std::cout << "Yes" << endl;
    return;
  }
  if (s.size() == 2 and mp.count(0)) {
    bool isok = true;
    for (auto n : s) {
      if (n == 0 and mp[n] != N / 3) {
        isok = false;
      }
    }
    if (isok) {
      std::cout << "Yes" << endl;
    } else {
      std::cout << "No" << endl;
    }
    return;
  }
  if (s.size() == 3) {
    int e = 0;
    for (auto n : s) {
      e ^= n;
    }
    if (e == 0) {
      std::cout << "Yes" << endl;
    } else {
      std::cout << "No" << endl;
    }
    return;
  }
  std::cout << "No" << endl;
  return;
}
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(20);
  solve();
  return 0;
}
