#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, j, c = 0, q = 0, maximum = 0, l = 0, abc = 0;
  cin >> n >> k;
  int a[n], b[5002], d[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]] = 0;
  }
  for (i = 0; i < n; i++) {
    b[a[i]]++;
    maximum = max(maximum, b[a[i]]);
    if (b[a[i]] > k) {
      c = 1;
      break;
    }
  }
  if (c == 1)
    cout << "NO";
  else {
    cout << "YES" << endl;
    int p = 0;
    for (i = 0; i < n; i++) {
      if (b[a[i]] > 0) {
        d[p] = b[a[i]];
        b[a[i]]--;
        p++;
      }
    }
    int o = 1;
    for (i = 0; i < n; i++) {
      if (k == maximum) break;
      if (d[i] == o && l == 0) {
        l = 1;
        continue;
      }
      if (d[i] == o) {
        d[i] = k;
        k--;
        if (k == maximum) abc = 1;
      }
      if (i == n - 1 && maximum < k) {
        o++;
        l = 0;
        i = -1;
      }
      if (abc == 1) break;
    }
    for (i = 0; i < n; i++) {
      cout << d[i] << " ";
    }
  }
}
