#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 11;
int n, a[N];
int main() {
  cin >> n;
  for (int i = (1), i_end = (n); i <= i_end; ++i) cin >> a[i];
  if (n % 3) {
    for (int i = (1), i_end = (n); i <= i_end; ++i)
      if (a[i]) {
        puts("No");
        return 0;
      }
    puts("Yes");
  } else {
    map<int, int> f;
    for (int i = (1), i_end = (n); i <= i_end; ++i) f[a[i]]++;
    int fl = 1, t = 0;
    for (auto p : f) {
      a[++t] = p.first;
      if (p.second != n / 3) fl = 0;
    }
    fl &= (a[1] ^ a[2] ^ a[3]) == 0;
    if (fl)
      puts("Yes");
    else
      puts("No");
  }
}
