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;
vector<int> fac(int x) {
  if (x == 1) return {};
  vector<int> ret;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      ret.emplace_back(i);
      while (x % i == 0) x /= i;
    }
  }
  if (x != 1) ret.emplace_back(x);
  return ret;
}
const int maxn = 112345;
const double eps = 1e-6;
int n, a[maxn], ans[maxn];
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  scanf("%d", &n);
  for (int(i) = (1); (i) <= (n); (i)++) scanf("%d", a + i);
  auto v1 = fac(a[1]);
  int k1 = v1.size();
  double e = k1 / double(n - 1), err = 1;
  set<int> checked;
  bool found = false;
  while (err >= eps && checked.size() < n - 1) {
    err *= e;
    int u = -1;
    do {
      u = uniform_int_distribution<int>(2, n)(rng);
    } while (checked.count(u));
    checked.emplace(u);
    auto v2 = fac(a[u]);
    int k2 = v2.size();
    vector<vector<char>> good(n + 1, vector<char>(20));
    for (int(i) = (2); (i) <= (n); (i)++)
      for (int(j) = (0); (j) <= ((k1)-1); (j)++) good[i][j] = a[i] % v1[j] != 0;
    for (int(i) = (2); (i) <= (n); (i)++)
      for (int(j) = (0); (j) <= ((k2)-1); (j)++)
        good[i][j + k1] = a[i] % v2[j] != 0;
    vector<pair<int, pair<int, int>>> candidates;
    vector<int> need(20, k1 + k2);
    for (int(i) = (2); (i) <= (n); (i)++)
      if (i != u) {
        bool sel = false;
        for (int(j) = (0); (j) <= ((k1 + k2) - 1); (j)++)
          if (need[j] && good[i][j]) {
            sel = true;
            need[j]--;
            break;
          }
        if (sel) {
          int mask1 = 0, mask2 = 0;
          for (int(j) = (0); (j) <= ((k1)-1); (j)++) mask1 |= (good[i][j] << j);
          for (int(j) = (0); (j) <= ((k2)-1); (j)++)
            mask2 |= (good[i][j + k1] << j);
          candidates.emplace_back(i, make_pair(mask1, mask2));
        }
      }
    vector<vector<vector<pair<int, int>>>> f;
    f.resize(candidates.size() + 1);
    for (auto &g : f) {
      g.resize(1 << k1);
      for (auto &h : g) h = vector<pair<int, int>>(1 << k2, make_pair(-1, -1));
    }
    f[0][0][0] = {0, 0};
    for (int(i) = (0); (i) <= ((int(candidates.size())) - 1); (i)++)
      for (int(mask1) = (0); (mask1) <= ((1 << k1) - 1); (mask1)++)
        for (int(mask2) = (0); (mask2) <= ((1 << k2) - 1); (mask2)++) {
          if (f[i][mask1][mask2].first == -1) continue;
          int m1 = candidates[i].second.first, m2 = candidates[i].second.second;
          int nmask1 = mask1 | m1, nmask2 = mask2 | m2;
          if (f[i + 1][nmask1][mask2].first == -1)
            f[i + 1][nmask1][mask2] = {mask1, mask2};
          if (f[i + 1][mask1][nmask2].second == -1)
            f[i + 1][mask1][nmask2] = {mask1, mask2};
        }
    if (f[candidates.size()][(1 << k1) - 1][(1 << k2) - 1].first == -1)
      continue;
    int mask1 = (1 << k1) - 1, mask2 = (1 << k2) - 1;
    ans[1] = 1;
    ans[u] = 2;
    for (int(i) = (candidates.size()); (i) >= (1); (i)--) {
      if (mask1 == f[i][mask1][mask2].first) {
        ans[candidates[i - 1].first] = 2;
        mask2 = f[i][mask1][mask2].second;
      } else {
        ans[candidates[i - 1].first] = 1;
        mask1 = f[i][mask1][mask2].first;
      }
    }
    for (int(i) = (2); (i) <= (n); (i)++)
      if (!ans[i]) ans[i] = 1;
    found = true;
    break;
  }
  if (found) {
    puts("YES");
    for (int(i) = (1); (i) <= (n); (i)++) printf("%d ", ans[i]);
  } else
    puts("NO");
}