Problem: You are given an array of n integers. You need to split all integers into two groups so that the GCD of all integers in the first group is equal to one and the GCD of all integers in the second group is equal to one.

The GCD of a group of integers is the largest non-negative integer that divides all the integers in the group.

Both groups have to be non-empty.

Input

The first line contains a single integer n (2 ≤ n ≤ 10^5).

The second line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9) — the elements of the array.

Output

In the first line print "YES" (without quotes), if it is possible to split the integers into two groups as required, and "NO" (without quotes) otherwise.

If it is possible to split the integers, in the second line print n integers, where the i-th integer is equal to 1 if the integer a_i should be in the first group, and 2 otherwise.

If there are multiple solutions, print any.

Examples

Input


4
2 3 6 7


Output


YES
2 2 1 1 


Input


5
6 15 35 77 22


Output


YES
2 1 2 1 1 


Input


5
6 10 15 1000 75


Output


NO

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int P[100005], c1, c2, g1[20], g2[20], pos[400], st1, mn, st2, e, n, i, j, k,
    from[170][1 << 9][1 << 9], p[100005], a[100005], cnt, u1[20], u2[20],
    is[100005];
inline int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void check(int now, int f1, int f2) {
  if (now > n) {
    if (f1 == 1 && f2 == 1) {
      cout << "YES\n";
      for (int i = 1; i <= n; ++i) cout << p[i] << " ";
      exit(0);
    }
    return;
  }
  p[now] = 1;
  check(now + 1, gcd(f1, a[now]), f2);
  p[now] = 2;
  check(now + 1, f1, gcd(f2, a[now]));
}
void solve(int x, int y) {
  int X = x, Y = y;
  x = a[x];
  y = a[y];
  memset(P, 0, sizeof(P));
  P[X] = 1;
  P[Y] = 2;
  c1 = c2 = 0;
  for (i = 1; i <= 3432; ++i) {
    if (x % p[i] == 0) {
      u1[++c1] = p[i];
      while (x % p[i] == 0) x /= p[i];
    }
  }
  if (x > 1) u1[++c1] = x;
  for (i = 1; i <= 3432; ++i) {
    if (y % p[i] == 0) {
      u2[++c2] = p[i];
      while (y % p[i] == 0) y /= p[i];
    }
  }
  if (y > 1) u2[++c2] = y;
  memset(g1, 0, sizeof(g1));
  memset(g2, 0, sizeof(g2));
  memset(from, 0, sizeof(from));
  from[0][(1 << c1) - 1][(1 << c2) - 1] = 1;
  for (cnt = 0, i = 1; i <= n; ++i) {
    if (i == X || i == Y) continue;
    mn = 666;
    st1 = st2 = 0;
    for (j = 1; j <= c1; ++j) {
      if (a[i] % u1[j] == 0)
        st1 |= (1 << j - 1);
      else
        mn = min(mn, g1[j]);
    }
    for (j = 1; j <= c2; ++j) {
      if (a[i] % u2[j] == 0)
        st2 |= (1 << j - 1);
      else
        mn = min(mn, g2[j]);
    }
    if (mn > 8) continue;
    pos[++cnt] = i;
    for (j = 1; j <= c1; ++j)
      if (a[i] % u1[j]) ++g1[j];
    for (j = 1; j <= c2; ++j)
      if (a[i] % u2[j]) ++g2[j];
    for (j = 0; j < (1 << c1); ++j)
      for (k = 0; k < (1 << c2); ++k) {
        if (from[cnt - 1][j][k]) {
          from[cnt][j & st1][k] = j << 9 | k;
          from[cnt][j][k & st2] = j << 9 | k;
        }
      }
    if (from[cnt][0][0]) {
      st1 = st2 = 0;
      for (; cnt; --cnt) {
        e = from[cnt][st1][st2];
        if ((e >> 9) != st1)
          P[pos[cnt]] = 1;
        else
          P[pos[cnt]] = 2;
        st1 = e >> 9;
        st2 = e & (511);
      }
      cout << "YES\n";
      for (i = 1; i <= n; ++i) {
        if (!P[i]) ++P[i];
        cout << P[i] << " ";
      }
      exit(0);
    }
  }
}
int x, y;
int main() {
  cin >> n;
  for (i = 2; i < 32000; ++i) {
    if (!is[i]) p[++cnt] = i;
    for (j = 1; j <= cnt && (i * p[j]) < 32000; ++j) {
      is[i * p[j]] = 1;
      if (i % p[j] == 0) break;
    }
  }
  for (i = 1; i <= n; ++i) cin >> a[i];
  if (n <= 23) {
    check(1, 0, 0);
    cout << "NO\n";
  } else {
    while (clock() <= 0.45 * CLOCKS_PER_SEC) {
      x = rand() % n + 1;
      y = rand() % n + 1;
      while (y == x) y = rand() % n + 1;
      solve(x, y);
    }
    cout << "NO\n";
  }
}