#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, x, a[N];
map<int, int> mp;
set<int> ss;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &x), a[i] = x, ss.insert(x), mp[x]++;
  if (n % 3 != 0 || ss.size() > 3) {
    puts("No");
    return 0;
  }
  if (ss.size() == 1) {
    if (a[1] == 0)
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  sort(a + 1, a + n + 1);
  int m = unique(a + 1, a + n + 1) - a - 1;
  if (ss.size() == 2) {
    if (a[1] && a[2]) return puts("No"), 0;
    if (mp[a[1]] * 2 == mp[a[2]])
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  if (mp[a[1]] == mp[a[2]] && mp[a[2]] == mp[a[3]] && a[1] ^ a[2] == a[3])
    puts("Yes");
  else
    puts("No");
}
