#include <bits/stdc++.h>
using namespace std;
const long long MOD = pow(10, 9) + 7;
const long long LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < (int)N; i++) cin >> a[i];
  string result = "No";
  if (N % 3 == 0) {
    map<int, int> count;
    for (int i = 0; i < (int)N; i++) count[a[i]]++;
    if (count.size() == 3) {
      int xsum = 0;
      bool ok = true;
      for (auto x : count) {
        if (x.second != N / 3) ok = false;
        xsum ^= x.first;
      }
      if (ok && xsum == 0) result = "Yes";
    } else if (count.size() == 2) {
      auto itr = count.begin();
      if (itr->first == 0 && itr->second == N / 3) result = "Yes";
    }
  }
  cout << result << endl;
  return 0;
}
