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;
void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x) return;
  print(x / 10), putchar(x % 10 + 48);
}
void write(int x) {
  if (!x)
    putchar('0');
  else
    print(x);
  putchar('\n');
}
const int maxn = 1e6 + 10;
const int inf = 1e9;
const double eps = 1e-8;
const int mod = 1e9 + 7;
int r[maxn], n, f[1100][1100], tt[maxn], w[2][1000], c[2][1000];
struct data {
  int s, t, w;
} pre[1100][1100];
void factorize(int x, int *a) {
  memset(a, 0, (sizeof x) * 20);
  for (int i = 2; i * i <= x; i++) {
    if (x % i) continue;
    a[++a[0]] = i;
    while (x % i == 0) x /= i;
  }
  if (x != 1) a[++a[0]] = x;
}
int p[maxn];
void prepare(int a, int b) {
  memset(c, 0, sizeof c);
  memset(w, 0, sizeof w);
  memset(p, 0, sizeof p);
  factorize(r[a], w[0]), factorize(r[b], w[1]);
  for (int i = 1; i <= n; i++) {
    if (i == a || i == b) continue;
    int bo = 0;
    for (int o = 0; o <= 1; o++) {
      for (int k = 1; k <= w[o][0]; k++)
        if (r[i] % w[o][k]) {
          if (c[o][k] == w[o ^ 1][0]) continue;
          c[o][k]++, bo = 1, p[++p[0]] = i;
          break;
        }
      if (bo) break;
    }
  }
}
int dp(int a, int b) {
  prepare(a, b);
  memset(tt, 0, sizeof tt);
  memset(f, 0, sizeof f);
  int k1 = w[0][0], k2 = w[1][0];
  f[(1 << k1) - 1][(1 << k2) - 1] = 1;
  tt[a] = 1, tt[b] = 2;
  for (int i = 1; i <= p[0]; i++) {
    int s1 = (1 << k1) - 1, t1 = (1 << k2) - 1;
    for (int j = 1; j <= k1; j++)
      if (r[p[i]] % w[0][j]) s1 ^= 1 << (j - 1);
    for (int j = 1; j <= k2; j++)
      if (r[p[i]] % w[1][j]) t1 ^= 1 << (j - 1);
    for (int s = 0; s < 1 << k1; s++)
      for (int t = 0; t < 1 << k2; t++) {
        if (!f[s][t]) continue;
        if (!f[s & s1][t])
          f[s & s1][t] = 1, pre[s & s1][t] = (data){s, t, p[i]};
        if (!f[s][t & t1])
          f[s][t & t1] = 1, pre[s][t & t1] = (data){s, t, p[i]};
      }
  }
  if (!f[0][0]) return 0;
  int s = 0, t = 0;
  while (!(s == (1 << k1) - 1 && t == (1 << k2) - 1)) {
    data d = pre[s][t];
    if (s != d.s)
      tt[d.w] = 1;
    else
      tt[d.w] = 2;
    s = d.s, t = d.t;
  }
  return 1;
}
int main() {
  read(n);
  srand(time(0));
  for (int i = 1; i <= n; i++) read(r[i]);
  for (int T = 1; T <= 10; T++) {
    int a = rand() % n + 1, b = rand() % n + 1;
    if (a == b) continue;
    if (!dp(a, b)) continue;
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", tt[i] ? tt[i] : 1);
    return 0;
  }
  puts("NO");
  return 0;
}