#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n, a[maxn], num[maxn][2], num0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int cnt = 1;
  for (int i = 2; i <= n; i++)
    if (a[i] != a[i - 1]) {
      num[++num0][0] = a[i - 1];
      num[num0][1] = cnt;
      cnt = 1;
    } else
      cnt++;
  num[++num0][0] = a[n], num[num0][1] = cnt;
  if (num0 > 3)
    puts("No");
  else if (num0 == 3) {
    if (n % 3) {
      puts("No");
      return 0;
    }
    if (num[1][1] != num[2][1] || num[1][1] != num[3][1]) {
      puts("No");
      return 0;
    }
    if (num[1][0] ^ num[2][0] != num[3][0]) {
      puts("No");
      return 0;
    }
    puts("Yes");
  } else if (num0 == 2) {
    if (n % 3) {
      puts("No");
      return 0;
    }
    if (num[1][0] == 0 && num[2][1] == 2 * num[1][1] ||
        num[2][0] == 0 && num[1][1] == 2 * num[2][1])
      puts("Yes");
    else
      puts("No");
  } else {
    puts((num[1][0] == 0) ? "Yes" : "No");
  }
}
