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 = 33_334;
  int n;
  int[] a, ans;
  int[][] rmq;
  boolean[] ps = new boolean[33334];
  List<Integer> pl = new ArrayList<>();

  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 buildPl() {
    Arrays.fill(ps, true);
    for (int i = 2; i * i < ps.length; i++)
      if (ps[i]) {
        pl.add(i);
        for (int j = i + i; j < ps.length; j += i) ps[j] = false;
      }
  }

  void buildRMQ() {
    int d = 0;
    for (; (1 << d) < n; d++) ;
    rmq = new int[n][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 a[i] % x == 0 ? n : i;
  }

  boolean 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) + " ");
      return true;
    }
    if (p == n) return false;
    int px = findNext(p, x), py = findNext(p, y);
    int np = Math.min(px, py);
    if (np >= n) return false;
    int nx = gcd(x, a[np]), ny = gcd(y, a[np]);
    if (nx != x && dfs(np + 1, nx, y)) return true;
    ans[np] = 1;
    boolean got = dfs(np + 1, x, ny);
    ans[np] = 0;
    if (got) return true;
    return false;
  }

  int clean(int i) {
    for (int p : pl) while (i % (p * p) == 0) i /= p;
    return i;
  }

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