#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
int a[N];
map<int, int> freq;
vector<int> v;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    freq[a[i]]++;
    if (freq[a[i]] == 1) v.push_back(a[i]);
  }
  if (freq[0] == n)
    printf("Yes\n");
  else if (n % 3 != 0) {
    printf("No\n");
    return 0;
  } else if (v.size() == 2) {
    if (freq[0] == n / 3) printf("Yes\n");
  } else if (v.size() == 3) {
    if (freq[v[0]] == n / 3 && freq[v[1]] == n / 3 && freq[v[2]] == n / 3) {
      if (v[0] ^ v[1] ^ v[2] == 0) {
        if (v[0] != v[1] && v[0] != v[2] && v[1] != v[2]) printf("Yes\n");
      }
    }
  } else
    printf("No\n");
}
