#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
int gcd(int a, int b) {
  int t;
  while (b > 0) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
ll asd(ll a) {
  double b = 0;
  ll i = 1;
  while (a > 0) {
    b += (a % 2) * i;
    a /= 2;
    i *= 10;
  }
  return b;
}
double qwe(ll a) {
  double b = 0;
  ll i = 1;
  while (a > 0) {
    if (a % 10 % 2 == 1) {
      b += i;
    }
    a /= 10;
    i *= 10;
  }
  return b;
}
int main() {
  ll a, b, c, d, e, k, l, m, n, o = 0, p, q, x, y, z, max1 = 0, ans;
  string s, t, u;
  cin >> n;
  ll a1[n];
  for (ll i = 0; i < n; i++) {
    cin >> a;
    a1[i] = asd(a);
  }
  sort(a1, a1 + n);
  if (n % 3 == 0) {
    for (ll i = 0; i < n; i += n / 3) {
      if (a1[i] != a1[i + n / 3 - 1]) o++;
    }
    if (qwe(a1[0] + a1[n / 3] + a1[n / 3 * 2]) == 0 && o == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (a1[n - 1] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
