#include <bits/stdc++.h>
struct num {
  int x;
  int times;
};
int main() {
  int n;
  std::vector<int> aList;
  std::vector<num> indList;
  bool isValid = true;
  std::cin >> n;
  aList.resize(n);
  indList.resize(n);
  for (int i = 0; i < n; i++) std::cin >> aList[i];
  std::sort(aList.begin(), aList.end());
  int kind = 0;
  indList[kind] = {aList[0], 1};
  for (int i = 1; i < n; i++) {
    if (aList[i - 1] != aList[i]) {
      kind++;
      indList[kind] = {aList[i], 1};
    } else {
      indList[kind].times++;
    }
  }
  kind++;
  if (kind > 3 || n % 3 != 0) isValid = false;
  if (isValid) {
    if (kind == 1)
      if (indList[0].x != 0) isValid = false;
    if (kind == 2) {
      if (indList[0].times == indList[1].times * 2) {
        indList[0].times = indList[1].times;
        indList[2] = {indList[0].x, indList[0].times};
      } else if (indList[0].times * 2 == indList[1].times) {
        indList[1].times = indList[0].times;
        indList[2] = {indList[1].x, indList[1].times};
      } else {
        isValid = false;
      }
    }
    if (kind == 3)
      if (indList[0].times != indList[1].times ||
          indList[1].times != indList[2].times)
        isValid = false;
  }
  if (isValid && (kind == 2 || kind == 3)) {
    while (indList[0].x != 0 || indList[1].x != 0 || indList[2].x != 0) {
      int num1 = 0;
      for (int i = 0; i < 3; i++) {
        num1 += indList[i].x % 2;
        indList[i].x = indList[i].x / 2;
      }
      if (num1 != 0 && num1 != 2) isValid = false;
    }
  }
  if (isValid)
    std::cout << "Yes" << std::endl;
  else
    std::cout << "No" << std::endl;
}
