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;
using std::cin;
using std::cout;
using std::endl;
namespace IN {
const int Max_Input_Number = 1000000;
char buf[Max_Input_Number], *p1, *p2;
template <typename T>
inline int input(T &x) {
  static std::streambuf *inbuf = cin.rdbuf();
  x = 0;
  register int f = 0, flag = 1;
  register char ch =
      (p1 == p2 &&
               (p2 = (p1 = buf) + inbuf->sgetn(buf, Max_Input_Number), p1 == p2)
           ? EOF
           : *p1++);
  if (ch == EOF) return EOF;
  while (!std::isdigit(ch)) {
    if (ch == '-') f = 1;
    ch = (p1 == p2 && (p2 = (p1 = buf) + inbuf->sgetn(buf, Max_Input_Number),
                       p1 == p2)
              ? EOF
              : *p1++);
  }
  if (std::isdigit(ch))
    x = x * 10 + (ch & 15),
    ch = (p1 == p2 && (p2 = (p1 = buf) + inbuf->sgetn(buf, Max_Input_Number),
                       p1 == p2)
              ? EOF
              : *p1++),
    flag = true;
  while (std::isdigit(ch)) {
    x = x * 10 + (ch & 15);
    ch = (p1 == p2 && (p2 = (p1 = buf) + inbuf->sgetn(buf, Max_Input_Number),
                       p1 == p2)
              ? EOF
              : *p1++);
  }
  x = f ? -x : x;
  return ch == EOF ? EOF : flag;
}
template <typename T, typename... Args>
inline int input(T &a, Args &...args) {
  return input(a) && input(args...);
}
inline int readc(char &ch) {
  static std::streambuf *inbuf = cin.rdbuf();
  return (ch = (p1 == p2 &&
                        (p2 = (p1 = buf) + inbuf->sgetn(buf, Max_Input_Number),
                         p1 == p2)
                    ? EOF
                    : *p1++)) == EOF
             ? EOF
             : 0;
}
inline int readst(char *st) {
  if (readc(*st) != EOF && (*st))
    while (readc(*(++st)) != EOF && *st != '\n')
      ;
  else
    return EOF;
  return 0;
}
}  // namespace IN
namespace OUT {
template <typename T>
inline void output(T x) {
  static std::streambuf *outbuf = cout.rdbuf();
  static char stack[21];
  static int top = 0;
  if (x < 0) {
    outbuf->sputc('-');
    x = -x;
  }
  if (!x) {
    outbuf->sputc('0');
    outbuf->sputc('\n');
    return;
  }
  while (x) {
    stack[++top] = x % 10 + '0';
    x /= 10;
  }
  while (top) {
    outbuf->sputc(stack[top]);
    --top;
  }
  outbuf->sputc('\n');
}
inline void putc(const char ch) {
  static std::streambuf *outbuf = cout.rdbuf();
  outbuf->sputc(ch);
}
template <typename T>
inline void output(const char ch, T x) {
  static std::streambuf *outbuf = cout.rdbuf();
  static char stack[21];
  static int top = 0;
  if (x < 0) {
    outbuf->sputc('-');
    x = -x;
  }
  if (!x) {
    outbuf->sputc('0');
    outbuf->sputc(ch);
    return;
  }
  while (x) {
    stack[++top] = x % 10 + '0';
    x /= 10;
  }
  while (top) {
    outbuf->sputc(stack[top]);
    --top;
  }
  outbuf->sputc(ch);
}
template <typename T, typename... Args>
inline void output(T a, Args... args) {
  output(a);
  output(args...);
}
template <typename T, typename... Args>
inline void output(const char ch, T a, Args... args) {
  output(ch, a);
  output(ch, args...);
}
inline void putst(const char *st) {
  static std::streambuf *outbuf = cout.rdbuf();
  int _len = strlen(st);
  const char *p = st;
  do {
    outbuf->sputc(*st);
    st++;
  } while (st + 1 < p + _len);
}
}  // namespace OUT
using IN::input;
using IN::readc;
using IN::readst;
using OUT::output;
using OUT::putc;
using OUT::putst;
const int N = 100010;
int a[N], p[N], ans[N];
int gcd(int a, int b) {
  int r = a % b;
  while (r) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(19260817);
  int n;
  input(n);
  for (int i = 1; i <= n; ++i) input(a[i]);
  for (int i = 1; i <= n; ++i) p[i] = i;
  int t = 100;
  while (t--) {
    random_shuffle(p + 1, p + 1 + n);
    int x = 0, y = 0, cnt;
    for (int i = 1; i <= n; ++i) {
      if ((x != 1) && ((cnt = gcd(x, a[p[i]])) != x))
        x = cnt, ans[p[i]] = 1;
      else
        y = gcd(y, a[p[i]]), ans[p[i]] = 2;
    }
    if (x == 1 && y == 1) {
      putst("YES\n");
      putc('\n');
      for (int i = 1; i <= n; ++i) output(' ', ans[i]);
      return 0;
    }
  }
  putst("NO\n");
  return 0;
}