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;
const int maxn = 1e5 + 5;
pair<int, int> seq[maxn];
int a[maxn], n, d1[10], d2[10], d1_cnt, d2_cnt, ans[maxn];
bool b[maxn], f[200][1 << 9][1 << 9];
bool contain(int a, int b) { return (a & b) == b; }
void getAns(int pos, int s1, int s2) {
  if (!pos) return;
  int t1 = 0, t2 = 0;
  for (int i = 0; i <= d1_cnt - 1; i++)
    if (seq[pos].first % d1[i]) t1 |= 1 << i;
  for (int i = 0; i <= d2_cnt - 1; i++)
    if (seq[pos].first % d2[i]) t2 |= 1 << i;
  t1 &= s1;
  t2 &= s2;
  bool flg = false;
  for (int i = 0; i <= (1 << d1_cnt) - 1; i++)
    for (int j = 0; j <= (1 << d2_cnt) - 1; j++)
      if (contain(i, s1 ^ t1) && contain(j, s2) && f[pos - 1][i][j]) flg = true;
  if (flg)
    ans[seq[pos].second] = 1, getAns(pos - 1, s1 ^ t1, s2);
  else
    ans[seq[pos].second] = 2, getAns(pos - 1, s1, s2 ^ t2);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i * i <= a[1]; i++)
    if (a[1] % i == 0) {
      d1[d1_cnt++] = i;
      while (a[1] % i == 0) a[1] /= i;
    }
  if (a[1] > 1) d1[d1_cnt++] = a[1];
  while (clock() < 300) {
    int p = rand() % (n - 1) + 2;
    d2_cnt = 0;
    int tmp = a[p];
    for (int i = 2; i * i <= tmp; i++)
      if (tmp % i == 0) {
        d2[d2_cnt++] = i;
        while (tmp % i == 0) tmp /= i;
      }
    if (tmp > 1) d2[d2_cnt++] = tmp;
    memset(b, 0, sizeof b);
    for (int i = 0; i <= d1_cnt - 1; i++) {
      int cnt = 0;
      for (int j = 2; j <= n && cnt < 10; j++)
        if (j != p && a[j] % d1[i]) {
          cnt++;
          b[j] = true;
        }
    }
    for (int i = 0; i <= d2_cnt - 1; i++) {
      int cnt = 0;
      for (int j = 2; j <= n && cnt < 10; j++)
        if (j != p && a[j] % d2[i]) {
          cnt++;
          b[j] = true;
        }
    }
    int seq_cnt = 0;
    for (int i = 2; i <= n; i++)
      if (b[i]) seq[++seq_cnt] = make_pair(a[i], i);
    memset(f, 0, sizeof f);
    f[0][0][0] = true;
    for (int i = 1; i <= seq_cnt; i++) {
      int t1 = 0, t2 = 0;
      for (int j = 0; j <= d1_cnt - 1; j++)
        if (seq[i].first % d1[j]) t1 |= 1 << j;
      for (int j = 0; j <= d2_cnt - 1; j++)
        if (seq[i].first % d2[j]) t2 |= 1 << j;
      for (int j = 0; j <= (1 << d1_cnt) - 1; j++)
        for (int k = 0; k <= (1 << d2_cnt) - 1; k++)
          if (f[i - 1][j][k])
            f[i][j | t1][k] = f[i][j][k | t2] = f[i][j][k] = true;
    }
    if (f[seq_cnt][(1 << d1_cnt) - 1][(1 << d2_cnt) - 1]) {
      getAns(seq_cnt, (1 << d1_cnt) - 1, (1 << d2_cnt) - 1);
      ans[1] = 1, ans[p] = 2;
      cout << "YES" << '\n';
      for (int i = 1; i <= n; i++)
        if (!ans[i])
          cout << 1 << ' ';
        else
          cout << ans[i] << ' ';
      return 0;
    }
  }
  cout << "NO" << '\n';
  return 0;
}