#include <bits/stdc++.h>
using namespace std;
int pre[5005][5005];
int main() {
  int n, k;
  bool flag = true;
  scanf("%d%d", &n, &k);
  map<int, int> m;
  for (int i = 1; i <= n; i++) {
    int yy;
    scanf("%d", &yy);
    m[yy]++;
    pre[yy][m[yy]] = i;
    if (m[yy] > k) flag = false;
  }
  int xx = 0;
  bool flag1 = false;
  int p[5005];
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= m[i]; j++) {
      p[pre[i][j]] = ++xx;
      if (xx == k) {
        flag1 = true;
        xx = 0;
      }
    }
  }
  if (flag == false || flag1 == false)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++) {
      cout << p[i] << " ";
    }
  }
  return 0;
}
