#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, cnt = 0, a, ten, tmp;
  int zerocnt = 0;
  cin >> N;
  vector<long long> hat(N);
  for (int i = 0; i < N; i++) {
    cin >> a;
    if (a == 0) zerocnt++;
    tmp = 0;
    ten = 0;
    while (a > 1) {
      tmp += pow(10, ten) * (a % 2);
      a = a / 2;
      ten++;
    }
    tmp += pow(10, ten) * (a % 2);
    hat[i] = tmp;
  }
  bool flag = false;
  if (zerocnt == N)
    flag = true;
  else if (zerocnt == N / 3) {
    int samenum = 0;
    int numcnt = 0;
    for (int i = 0; i < N; i++) {
      if (hat[i] != 0 && samenum == 0) {
        samenum = hat[i];
      } else if (samenum == hat[i]) {
        numcnt++;
      }
    }
    if (numcnt == 2 * N / 3) {
      flag = true;
    }
  } else {
    int x, y = 0, z = 0;
    x = hat[0];
    flag = true;
    for (int i = 1; i < N; i++) {
      if (hat[i] != x && y == 0) {
        y = hat[i];
      } else if (hat[i] != x && z == 0) {
        z = hat[i];
      }
      if (hat[i] != x && hat[i] != y && hat[i] != z) {
        flag = false;
        break;
      }
    }
    if (flag) {
      long long rakuda = x + y;
      string raku = to_string(rakuda);
      tmp = 0;
      ten = 0;
      for (int j = raku.size() - 1; j >= 0; j--) {
        if (raku.at(j) == '2') {
          rakuda -= pow(10, ten) * 2;
          raku = to_string(rakuda);
        }
        ten++;
      }
      rakuda += z;
      raku = to_string(rakuda);
      tmp = 0;
      ten = 0;
      for (int j = raku.size() - 1; j >= 0; j--) {
        if (raku.at(j) == '2') {
          rakuda -= pow(10, ten) * 2;
          raku = to_string(rakuda);
        }
        ten++;
      }
      if (rakuda != 0) flag = false;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
