#include <bits/stdc++.h>
using namespace std;
int n, a[100005], st[100], top;
map<int, int> mp;
int main() {
  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;
  } else {
    for (int i = 1; i <= n; ++i) {
      if (!mp[a[i]]) st[++top] = a[i];
      if (top > 3) {
        puts("No");
        return 0;
      }
      ++mp[a[i]];
    }
    if (top != 3) {
      puts("No");
      return 0;
    }
    if (st[1] ^ st[2] ^ st[3]) {
      puts("No");
      return 0;
    }
    if (mp[st[1]] == mp[st[2]] && mp[st[2]] == mp[st[3]]) {
      puts("Yes");
      return 0;
    } else {
      puts("No");
      return 0;
    }
  }
  return 0;
}
