#include <bits/stdc++.h>
using namespace std;
int cnt_b[3];
bool bit(int n) {
  while (n) {
    if (n % 2 == 0) {
      return false;
    }
    n /= 2;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int b[3];
  int a[100005];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int cnt = 0;
  b[0] = a[0];
  cnt_b[0] = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] != b[cnt]) {
      cnt++;
      if (cnt > 2) {
        cout << "No" << endl;
        return 0;
      }
      b[cnt] = a[i];
    }
    cnt_b[cnt]++;
  }
  if (cnt == 0) {
    if (b[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (cnt == 1) {
    if (b[0] != 0) {
      cout << "No" << endl;
      return 0;
    }
    b[2] = b[1];
    cnt_b[2] = cnt_b[1] / 2;
    cnt_b[1] = cnt_b[2];
  }
  if (cnt_b[0] != n / 3 || cnt_b[1] != n / 3) {
    cout << "No" << endl;
    return 0;
  }
  while (b[0] == 0 && b[1] == 0 && b[2] == 0) {
    if (!(b[0] % 2 + b[1] % 2 + b[2] % 2 == 2 ||
          b[0] % 2 + b[1] % 2 + b[2] % 2 == 0)) {
      cout << "No" << endl;
      return 0;
    }
    b[0] /= 2;
    b[1] /= 2;
    b[2] /= 2;
  }
  cout << "Yes" << endl;
  return 0;
}
