#include <bits/stdc++.h>
int cnt[5005];
int arr[5005];
int kk[5005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    arr[i] = v;
    cnt[v]++;
  }
  int high_freq = 1;
  for (int i = 1; i <= 5000; i++) {
    if (cnt[i] > cnt[high_freq]) {
      high_freq = i;
    }
    if (cnt[i] > k) {
      printf("NO");
      return 0;
    }
  }
  printf("YES\n");
  kk[5002] = cnt[high_freq];
  if (cnt[high_freq] != k) {
    int diff = k - cnt[high_freq];
    for (int i = 0; i < n; i++) {
      if (arr[i] != high_freq) {
        arr[i] = 5002;
        diff--;
      }
      if (diff == 0) break;
    }
  }
  for (int i = 0; i < n; i++) {
    int a = arr[i];
    printf("%d ", ++kk[a]);
  }
}
