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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Set;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.SplittableRandom;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }

            SplittableRandom random = new SplittableRandom();
            for (int iter = 0; iter < 20; iter++) {
                int index1 = random.nextInt(n);
                int index2 = random.nextInt(n);
                if (index1 == index2) {
                    continue;
                }

                int[] primes;
                int k;
                {
                    Set<Integer> set = new TreeSet<>();
                    for (Factor f : factorize(a[index1])) {
                        set.add((int) f.p);
                    }
                    for (Factor f : factorize(a[index2])) {
                        set.add((int) f.p);
                    }
                    primes = new int[set.size()];
                    k = 0;
                    for (int p : set) {
                        primes[k++] = p;
                    }
                }

                int[] candidates = new int[2 * k];
                int numCandidates = 0;
                int[] numCutting = new int[k];
                for (int i = 0; i < n; i++) {
                    if (i == index1 || i == index2) {
                        continue;
                    }
                    for (int pId = 0; pId < k; pId++) {
                        if (a[i] % primes[pId] == 0) {
                            continue;
                        }
                        if (numCutting[pId] < 2) {
                            candidates[numCandidates++] = i;
                            ++numCutting[pId];
                            break;
                        }
                    }
                }
                candidates = Arrays.copyOf(candidates, numCandidates);

                int[] idInFirst = new int[k];
                int[] primesInFirst = new int[k];
                Arrays.fill(idInFirst, -1);
                int k1 = 0;
                for (int pId = 0; pId < k; pId++) {
                    if (a[index1] % primes[pId] == 0) {
                        primesInFirst[k1] = pId;
                        idInFirst[pId] = k1++;
                    }
                }
                primesInFirst = Arrays.copyOf(primesInFirst, k1);

                int[] idInSecond = new int[k];
                int[] primesInSecond = new int[k];
                Arrays.fill(idInSecond, -1);
                int k2 = 0;
                for (int pId = 0; pId < k; pId++) {
                    if (a[index2] % primes[pId] == 0) {
                        primesInSecond[k2] = pId;
                        idInSecond[pId] = k2++;
                    }
                }
                primesInSecond = Arrays.copyOf(primesInSecond, k2);

                boolean[][][] can = new boolean[numCandidates + 1][1 << k1][1 << k2];
                int[][][] via = new int[numCandidates + 1][1 << k1][1 << k2];
                int[][][] viaMask = new int[numCandidates + 1][1 << k1][1 << k2];
                can[0][0][0] = true;
                for (int i = 0; i < numCandidates; i++) {
                    for (int mask1 = 0; mask1 < 1 << k1; mask1++) {
                        for (int mask2 = 0; mask2 < 1 << k2; mask2++) {
                            if (!can[i][mask1][mask2]) {
                                continue;
                            }
                            if (!can[i + 1][mask1][mask2]) {
                                can[i + 1][mask1][mask2] = true;
                                via[i + 1][mask1][mask2] = 0;
                            }
                            int nmask1 = mask1 | coveredBy(a[candidates[i]], primes, primesInFirst, idInFirst);
                            if (!can[i + 1][nmask1][mask2]) {
                                can[i + 1][nmask1][mask2] = true;
                                via[i + 1][nmask1][mask2] = 1;
                                viaMask[i + 1][nmask1][mask2] = mask1;
                            }
                            int nmask2 = mask2 | coveredBy(a[candidates[i]], primes, primesInSecond, idInSecond);
                            if (!can[i + 1][mask1][nmask2]) {
                                can[i + 1][mask1][nmask2] = true;
                                via[i + 1][mask1][nmask2] = 2;
                                viaMask[i + 1][mask1][nmask2] = mask2;
                            }
                        }
                    }
                }

                int mask1 = (1 << k1) - 1;
                int mask2 = (1 << k2) - 1;
                if (!can[numCandidates][mask1][mask2]) {
                    continue;
                }
                int[] ans = new int[n];
                Arrays.fill(ans, 1);
                ans[index2] = 2;

                for (int i = numCandidates; i > 0; i--) {
                    int where = via[i][mask1][mask2];
                    if (where == 0) {

                    } else if (where == 1) {
                        mask1 = viaMask[i][mask1][mask2];
                    } else {
                        mask2 = viaMask[i][mask1][mask2];
                        ans[candidates[i - 1]] = 2;
                    }
                }

                out.println("YES");
                for (int i = 0; i < n; i++) {
                    if (i > 0) {
                        out.print(" ");
                    }
                    out.print(ans[i]);
                }
                out.println();
                return;
            }
            out.println("NO");
        }

        private int coveredBy(int x, int[] primes, int[] primesInFirst, int[] idInFirst) {
            int mask = 0;
            for (int pId : primesInFirst) {
                if (x % primes[pId] != 0) {
                    mask |= 1 << idInFirst[pId];
                }
            }
            return mask;
        }

        private Factor[] factorize(long n) {
            List<Factor> res = new ArrayList<>();
            for (long p = 2; p * p <= n; p++) {
                if (n % p == 0) {
                    Factor f = new Factor();
                    f.p = p;
                    while (n % p == 0) {
                        n /= p;
                        ++f.s;
                    }
                    res.add(f);
                }
            }
            if (n > 1) {
                Factor f = new Factor();
                f.p = n;
                f.s = 1;
                res.add(f);
            }
            return res.toArray(new Factor[0]);
        }

        class Factor {
            long p;
            int s;

        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}