#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int n;
  scanf("%d", &n);
  unordered_map<int, int> m;
  for (int i = 0, x; i < n; ++i) {
    scanf("%d", &x);
    m[x]++;
  }
  if (m.size() == 1) {
    return m.begin()->first == 0;
  }
  if (m.size() != 3) {
    return false;
  }
  vector<pair<int, int>> v(m.begin(), m.end());
  return (v[0].second == v[1].second) && (v[1].second == v[2].second) &&
         ((v[0].first ^ v[1].first ^ v[2].first) == 0);
}
int main() {
  puts(solve() ? "Yes" : "No");
  return 0;
}
