#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, a[N];
map<int, int> mp;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    mp[a[i]]++;
  }
  sort(a + 1, a + n + 1);
  if (mp[0] == n) {
    puts("Yes");
    return 0;
  }
  if (n % 3) {
    puts("No");
    return 0;
  }
  bool flag = 1;
  if (a[1] != a[n / 3] || a[n / 3 + 1] != a[2 * n / 3] ||
      a[2 * n / 3 + 1] != a[n])
    flag = 0;
  if (a[0] ^ a[n / 3 + 1] ^ a[2 * n / 3 + 1]) flag = 0;
  if (flag)
    puts("Yes");
  else
    puts("No");
}
