#include <bits/stdc++.h>
using namespace std;
struct node {
  int v, id;
} a[5010];
int tot = 1, T, col[5010], check[5010], cnt[5010];
bool mycmp(node x, node y) { return x.v < y.v; }
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].v), a[i].id = i;
  sort(a + 1, a + n + 1, mycmp);
  for (int i = 1; i <= n; ++i) cnt[a[i].v]++, tot = max(tot, cnt[a[i].v]);
  if (tot > k) {
    puts("NO");
    return 0;
  }
  tot = 0;
  for (int i = 1; i <= n; ++i) col[a[i].id] = (++(tot %= k));
  for (int i = 1; i <= n; ++i) T = max(T, col[a[i].id]);
  if (T < k)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", col[i]);
  }
  return 0;
}
