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;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(int x) {
  static const int maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  int len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (int i = len - 1; i >= 0; --i) putchar(s[i]);
}
const int MAXN = 110000;
int n;
int a[MAXN];
int pri_x[MAXN], cnt_x;
int pri_y[MAXN], cnt_y;
bool vis[MAXN];
int candi[MAXN], cnt_candi;
void get_pri(int val, int pri[], int &cnt) {
  cnt = 0;
  for (int i = 2; i <= sqrt(val); i++)
    if (val % i == 0) {
      pri[++cnt] = i;
      while (val % i == 0) val /= i;
    }
  if (val != 1) pri[++cnt] = val;
}
void get_candi(int val, int x_id, int y_id) {
  int tmp = 0;
  for (int i = 1; i <= n; i++)
    if ((i != x_id) && (i != y_id) && (a[i] % val != 0)) {
      vis[i] = 1;
      tmp++;
      if (tmp == cnt_x + cnt_y) break;
    }
}
int gcd(int x, int y) { return (y == 0) ? x : gcd(y, x % y); }
bool f[(1 << 20) + 10];
struct kt {
  int pre;
  int id, flag;
  kt() {}
  kt(int pre, int id, int flag) : pre(pre), id(id), flag(flag) {}
};
kt from[(1 << 20) + 10];
int ans[MAXN];
bool solve(int x, int y) {
  for (int i = 0; i < (1 << (cnt_x + cnt_y)); i++) f[i] = 0;
  f[0] = 1;
  for (int i = 1; i <= cnt_candi; i++) {
    int tmp1 = 0;
    for (int j = 1; j <= cnt_x; j++)
      if (gcd(pri_x[j], a[candi[i]]) == 1) tmp1 |= (1 << (j - 1));
    int tmp2 = 0;
    for (int j = 1; j <= cnt_y; j++)
      if (gcd(pri_y[j], a[candi[i]]) == 1) tmp2 |= (1 << (cnt_x + j - 1));
    for (int j = (1 << (cnt_x + cnt_y)) - 1; j >= 0; j--)
      if (f[j]) {
        if (!f[j | tmp1]) {
          from[j | tmp1] = kt(j, candi[i], 1);
          f[j | tmp1] = 1;
        }
        if (!f[j | tmp2]) {
          from[j | tmp2] = kt(j, candi[i], 2);
          f[j | tmp2] = 1;
        }
      }
  }
  if (f[(1 << (cnt_x + cnt_y)) - 1]) {
    int now = (1 << (cnt_x + cnt_y)) - 1;
    kt tmp;
    while (now) {
      tmp = from[now];
      ans[tmp.id] = tmp.flag;
      now = tmp.pre;
    }
    ans[x] = 1;
    ans[y] = 2;
    for (int i = 1; i <= n; i++)
      if (ans[i] == 0) ans[i] = 1;
    puts("YES");
    for (int i = 1; i < n; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[n]);
    return 1;
  }
  return 0;
}
bool dfs(int x, int g1, int g2) {
  if (x > n) {
    if ((g1 == 1) && (g2 == 1)) {
      puts("YES");
      for (int i = 1; i < n; i++) printf("%d ", ans[i]);
      printf("%d\n", ans[n]);
      return 1;
    }
    return 0;
  }
  ans[x] = 1;
  if (g1 != 0) {
    if (dfs(x + 1, gcd(g1, a[x]), g2)) return 1;
  } else {
    if (dfs(x + 1, a[x], g2)) return 1;
  }
  ans[x] = 2;
  if (g2 != 0) {
    if (dfs(x + 1, g1, gcd(g2, a[x]))) return 1;
  } else {
    if (dfs(x + 1, g1, a[x])) return 1;
  }
  return 0;
}
int id[MAXN];
int main() {
  srand(12371);
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]);
  if (n <= 20) {
    if (!dfs(1, 0, 0)) puts("NO");
    return 0;
  }
  for (int i = 1; i <= n; i++) id[i] = i;
  random_shuffle(id + 1, id + n + 1);
  int tot = 0;
  int st = 1;
  while (tot <= 1e7) {
    int x = a[id[st]];
    int y = a[id[st + 1]];
    cnt_x = cnt_y = 0;
    get_pri(x, pri_x, cnt_x);
    get_pri(y, pri_y, cnt_y);
    for (int i = 1; i <= n; i++) vis[i] = 0;
    for (int i = 1; i <= cnt_x; i++) get_candi(pri_x[i], id[st], id[st + 1]);
    for (int i = 1; i <= cnt_y; i++) get_candi(pri_y[i], id[st], id[st + 1]);
    cnt_candi = 0;
    for (int i = 1; i <= n; i++)
      if (vis[i]) candi[++cnt_candi] = i;
    tot += (1 << (cnt_x + cnt_y)) * cnt_candi + n * (cnt_x + cnt_y);
    if (solve(id[st], id[st + 1])) {
      return 0;
    }
    st += 2;
    if (st + 1 > n) {
      random_shuffle(id + 1, id + n + 1);
      st = 1;
    }
  }
  puts("NO");
  return 0;
}