#include <bits/stdc++.h>
long long read() {
  long long res = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) res = res * 10 + ch - 48, ch = getchar();
  return res * flag;
}
void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + 48);
}
const long long N = 5000 + 5;
long long n, k, a[N], c[N];
std::vector<long long> g[N];
void solution() {
  n = read(), k = read();
  long long tot = 0;
  for (long long i = (1); i <= (n); ++i) a[i] = read(), g[a[i]].push_back(i);
  for (long long i = (1); i <= (N - 1); ++i) {
    if (g[i].size() > k) {
      puts("NO");
      return;
    }
    for (auto v : g[i]) c[v] = ++tot, tot %= k;
  }
  puts("YES");
  for (long long i = (1); i <= (n); ++i) print(c[i]), putchar(' ');
  putchar('\n');
}
signed main() {
  42;
  solution();
}
