#include <bits/stdc++.h>
int data[5005];
int target1[5005];
int target2[5005];
int main() {
  memset(data, 0, sizeof(data));
  memset(target1, 0, sizeof(target1));
  memset(target2, 0, sizeof(target2));
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", data + i);
    target1[data[i]]++;
    target2[data[i]] = 1;
    if (target1[data[i]] > k) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  int k_ptr = k;
  for (int i = 0; i < n; ++i) {
    if (k_ptr > target1[data[i]]) {
      if (target2[data[i]]) {
        target2[data[i]] = 0;
        int temp = target1[data[i]];
        target1[data[i]] = k_ptr;
        k_ptr -= temp;
      }
    } else {
      target2[data[i]] = 0;
    }
    printf("%d ", target1[data[i]]--);
  }
  return 0;
}
