#include <bits/stdc++.h>
using namespace std;
int n, a[100005], st[100], top;
map<int, int> mp;
int main() {
  freopen("in", "r", stdin);
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  if (n % 3) {
    for (int i = 1; i <= n; ++i)
      if (a[i]) {
        puts("No");
        return 0;
      }
    puts("Yes");
    return 0;
  }
  int flag = 1;
  for (int i = 1; i <= n; ++i)
    if (a[i]) flag = 0;
  if (flag) {
    puts("Yes");
    return 0;
  } else {
    sort(a + 1, a + n + 1);
    for (int i = 2; i <= n / 3; ++i)
      if (a[i] != a[i - 1]) {
        puts("No");
        return 0;
      }
    for (int i = n / 3 + 2; i <= n * 2 / 3; ++i)
      if (a[i] != a[i - 1]) {
        puts("No");
        return 0;
      }
    for (int i = n * 2 / 3 + 2; i <= n; ++i)
      if (a[i] != a[i - 1]) {
        puts("No");
        return 0;
      }
    if (a[1] ^ a[n / 3 + 1] ^ a[n * 2 / 3 + 1]) {
      puts("No");
      return 0;
    }
    puts("Yes");
  }
  return 0;
}
