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 N = 1e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, a[N], st[N], tp = 0, s1[N], s2[N], ans[N], h[160][515][515];
bool f[160][515][515], g[160][515][515];
vector<int> fac(int n) {
  vector<int> ret;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) {
      ret.push_back(i);
      while (n % i == 0) n /= i;
    }
  if (n > 1) ret.push_back(n);
  return ret;
}
void print(int i, int j, int k) {
  if (!i) return;
  ans[st[i]] = (int)g[i][j][k] + 1;
  if (!g[i][j][k])
    print(i - 1, h[i][j][k], k);
  else
    print(i - 1, j, h[i][j][k]);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = gi();
  for (int T = 1; T <= 5; T++) {
    memset(s1, 0, sizeof(s1));
    memset(s2, 0, sizeof(s2));
    int x = rand() % n + 1, y = rand() % n + 1;
    while (x == y) x = rand() % n + 1, y = rand() % n + 1;
    vector<int> A = fac(a[x]), B = fac(a[y]);
    tp = 0;
    int id1 = 0, id2 = 0;
    for (auto p : A) {
      int cnt = 0;
      for (int i = 1; i <= n; i++) {
        if (i == x || i == y) continue;
        if (a[i] % p != 0) {
          st[++tp] = i, s1[i] |= 1 << id1, ++cnt;
          if (cnt == 10) break;
        }
      }
      ++id1;
    }
    for (auto p : B) {
      int cnt = 0;
      for (int i = 1; i <= n; i++) {
        if (i == x || i == y) continue;
        if (a[i] % p != 0) {
          st[++tp] = i, s2[i] |= 1 << id2, ++cnt;
          if (cnt == 10) break;
        }
      }
      ++id2;
    }
    sort(st + 1, st + tp + 1);
    tp = unique(st + 1, st + tp + 1) - st - 1;
    memset(f, 0, sizeof(f));
    f[0][0][0] = 1;
    for (int i = 0; i < tp; i++)
      for (int j = 0; j < (1 << id1); j++)
        for (int k = 0; k < (1 << id2); k++) {
          if (!f[i][j][k]) continue;
          f[i + 1][j | s1[st[i + 1]]][k] = 1;
          g[i + 1][j | s1[st[i + 1]]][k] = 0;
          h[i + 1][j | s1[st[i + 1]]][k] = j;
          f[i + 1][j][k | s2[st[i + 1]]] = 1;
          g[i + 1][j][k | s2[st[i + 1]]] = 1;
          h[i + 1][j][k | s2[st[i + 1]]] = k;
        }
    if (f[tp][(1 << id1) - 1][(1 << id2) - 1]) {
      puts("YES");
      for (int i = 1; i <= n; i++) {
        if (i == y)
          ans[i] = 2;
        else
          ans[i] = 1;
      }
      print(tp, (1 << id1) - 1, (1 << id2) - 1);
      for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
      return 0;
    }
  }
  puts("NO");
  return 0;
}