#include <bits/stdc++.h>
using namespace std;
int n, a[100005], mk[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  if (n % 3 == 0) {
    int cnt = 0;
    for (int i = 2; i <= n; i++)
      if (a[i] != a[i - 1]) mk[++cnt] = i;
    if ((cnt != 2) || (mk[1] != n / 3 + 1) || (mk[2] != (n / 3) * 2 + 1) ||
        (a[1] ^ a[n / 2] != a[n]))
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else {
    if (a[n] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
