#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int N, a[maxn];
pair<int, int> b[3];
map<int, int> m;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &a[i]), m[a[i]]++;
  if (m.size() == 1 && m[0] == N) return printf("Yes\n"), abort(), 0;
  if (m.size() == 2 && m[0] > 0 && m[0] * 3 == N) return printf("Yes\n"), 0;
  if (m.size() == 3) {
    int cnt = 0;
    for (pair<int, int> p : m) b[cnt++] = p;
    if (b[0].first ^ b[1].first ^ b[2].first == 0 &&
        b[0].second == b[1].second && b[0].second == b[2].second)
      return printf("Yes\n"), 0;
  }
  abort();
  printf("No\n");
}
