#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int a[N], n;
map<int, int> ma;
int main() {
  bool f = true;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ma[a[i]]++;
  }
  if (n == 3 && a[0] ^ a[1] == a[2] ||
      ma.size() <= 2 && (ma[0] == n || ma[0] == n / 2))
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
