#include <bits/stdc++.h>
using namespace std;
map<int, int> dp;
map<int, int>::iterator its;
int main() {
  int n, a;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    dp[a]++;
  }
  if (dp.size() != 3 || n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  int mx = 0;
  vector<int> v;
  for (its = dp.begin(); its != dp.end(); its++) {
    v.push_back(its->first);
    mx = max(mx, its->second);
  }
  if ((v[0] ^ v[1]) != v[2] || n / 3 != mx) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
}
