#include <bits/stdc++.h>
using namespace std;
int t, n;
long long A[100005];
int main() {
  for (; ~scanf("%d", &n);) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%lld", &A[i]);
    sort(A + 1, A + n + 1);
    if (n % 3 == 0) {
      long long a = A[1], b = A[n / 3 + 1], c = A[n / 3 * 2 + 1];
      if (a != A[n / 3] || b != A[n / 3 * 2] || c != A[n] || (a ^ b ^ c) != 0)
        puts("No");
      else
        puts("Yes");
    } else {
      if (!A[0] && !A[n])
        puts("Yes");
      else
        puts("No");
    }
  }
}
