#include <bits/stdc++.h>
bool solve(void) {
  int n;
  scanf("%d", &n);
  std::vector<int> nums(n);
  for (int i = 0; i < n; i++) scanf("%d", &nums[i]);
  std::map<int, int> nummap;
  for (auto num : nums) nummap[num]++;
  std::vector<std::pair<int, int>> indvs;
  for (auto indv : nummap) indvs.push_back(indv);
  if (nummap.size() > 3)
    return false;
  else if (nummap.size() == 1)
    return indvs[0].first == 0;
  else if (nummap.size() == 2) {
    int zerocount, nonzerocount;
    if (indvs[0].first == 0)
      zerocount = indvs[0].second, nonzerocount = indvs[1].second;
    else if (indvs[1].first == 0)
      zerocount = indvs[1].second, nonzerocount = indvs[0].second;
    else
      return false;
    return zerocount * 2 == nonzerocount;
  } else {
    if (indvs[0].first ^ indvs[1].first != indvs[2].first) return false;
    for (int i = 0; i < 3; i++)
      if (indvs[i].second != indvs[(i + 1) % 3].second) return false;
    return true;
  }
}
int main(void) {
  if (solve())
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
