#include <bits/stdc++.h>
int main() {
  int n, k, a[5005], rec[5005] = {0}, ans[5005] = {0};
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    rec[a[i]]++;
  }
  int num = 0, id = 0;
  for (int i = 0; i < 5005; i++)
    if (num < rec[i]) {
      num = rec[i];
      id = i;
    }
  if (num > k)
    printf("NO");
  else {
    printf("YES\n");
    int s = 0;
    for (int i = 0; i < n; i++)
      if (a[i] != id) {
        if (s >= k - num) break;
        ans[i] = s + num + 1;
        s++;
      }
    for (int i = 0; i < n; i++)
      if (ans[i] == 0) {
        ans[i] = rec[a[i]];
        rec[a[i]]--;
      }
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  }
}
