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 JAVA):

Solution:
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Test {

  static PrintWriter writer =
      new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
  int n;
  int[] a, ans;
  int[][] rmq;

  static int readInt() {
    int ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static long readLong() {
    long ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static String readLine() {
    StringBuilder b = new StringBuilder();
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (Character.isLetterOrDigit(c)) {
          start = true;
          b.append((char) c);
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return b.toString();
  }

  public static void main(String[] args) {
    Test te = new Test();
    te.start();
    writer.flush();
  }

  int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
  }

  void buildRMQ() {
    int d = Integer.numberOfTrailingZeros(Integer.highestOneBit(n)) + 1;
    rmq = new int[1 << d][d];
    for (int i = 0; i < n; i++) rmq[i][0] = a[i];
    for (int i = 1; i <= d; i++)
      for (int j = 0; j + (1 << i) <= n; j++)
        rmq[j][i] = gcd(rmq[j][i - 1], rmq[j + (1 << (i - 1))][i - 1]);
  }

  int findNext(int p, int x) {
    int d = rmq[0].length;
    int i = p;
    for (; d >= 0; d--) if (i + (1 << d) <= n && rmq[i][d] % x == 0) i += (1 << d);
    return i;
  }

  void dfs(int p, int x, int y) {
    if (x == 1 && y == 1) {
      writer.println("YES");
      for (int i = 0; i < n; i++) writer.print((ans[i] == 0 ? 1 : 2) + " ");
      writer.flush();
      System.exit(0);
    }
    if (p == n) return;
    int px = findNext(p, x), py = findNext(p, y);
    int np = Math.min(px, py);
    if (np >= n) return;
    int nx = gcd(x, a[np]), ny = gcd(y, a[np]);
    if (nx != x) dfs(np + 1, nx, y);
    if (ny != y) {
      ans[np] = 1;
      dfs(np + 1, x, ny);
      ans[np] = 0;
    }
  }

  int clean(int x) {
    int t = 1;
    for (int i = 2; i*i <= x; i++)
      if (x % i == 0) {
        t *= i;
        x /= i;
        while (x % i == 0) x /= i;
      }
    return t*x;
  }

  void start() {
    n = readInt();
    a = new int[n];
    ans = new int[n];
    for (int i = 0; i < n; i++) a[i] = readInt();
    buildRMQ();
    int x = clean(a[0]);
    for (int i = 1; i < n; i++) {
      ans[i] = 1;
      a[i] = clean(a[i]);
      dfs(i + 1, x, a[i]);
      ans[i] = 0;
      if (a[i] % x == 0) break;
      x = gcd(x, a[i]);
    }
    writer.println("NO");
  }
}