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;
namespace myrand {
mt19937 mt(chrono::system_clock::now().time_since_epoch() /
           chrono::microseconds(1));
long long Int(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(mt);
}
}  // namespace myrand
using namespace myrand;
const int N = 1e5 + 10;
const double mtim = 0.4;
int n, a[N], p[N], ans[N];
auto ss = chrono::system_clock::now();
double remain_time() {
  auto en = chrono::system_clock::now();
  return mtim -
         (chrono::duration_cast<chrono::nanoseconds>(en - ss).count() * 1e-9);
}
void read() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
}
int gcd(int t1, int t2) {
  while (t2) {
    int tmp = t1 % t2;
    t1 = t2;
    t2 = tmp;
  }
  return t1;
}
vector<int> vt1, vt2;
bool minimize() {
  if (vt1.size() == 1) return false;
  vector<int> vt;
  vt.push_back(vt1.back());
  int di = a[vt.back()];
  for (int i = 0; i < (int)vt1.size() - 1; i++)
    if (a[vt1[i]] % di == 0)
      vt2.push_back(vt1[i]);
    else {
      di = gcd(di, a[vt1[i]]);
      vt.push_back(vt1[i]);
    }
  if (vt1.size() == vt.size()) return false;
  vt1 = vt;
  return true;
}
bool check() {
  vt1.clear();
  vt2.clear();
  vt1.push_back(p[1]);
  int di = a[p[1]];
  for (int i = 2; i <= n; i++)
    if (a[p[i]] % di == 0)
      vt2.push_back(p[i]);
    else {
      di = gcd(di, a[p[i]]);
      vt1.push_back(p[i]);
    }
  bool flag = true;
  while (flag) flag = minimize();
  if (vt2.empty()) return false;
  di = a[vt2[0]];
  for (int x : vt2) di = gcd(a[x], di);
  return (di == 1);
}
int rng(int x) { return Int(0, x - 1); }
void process() {
  int di = 0;
  for (int i = 1; i <= n; i++) di = gcd(a[i], di);
  if (di > 1) {
    cout << "NO";
    return;
  }
  for (int i = 1; i <= n; i++) p[i] = i;
  while (remain_time() > 0) {
    random_shuffle(p + 1, p + n + 1, rng);
    if (check()) {
      for (int x : vt1) ans[x] = 1;
      for (int x : vt2) ans[x] = 2;
      cout << "YES\n";
      for (int i = 1; i <= n; i++) cout << ans[i] << " ";
      return;
    }
  }
  cout << "NO";
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  read();
  process();
  return 0;
}