#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int v[N];
vector<int> frecv[N];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
    frecv[v[i]].push_back(i);
    if (frecv[v[i]].size() > k) {
      printf("NO");
      return 0;
    }
  }
  printf("YES\n");
  int cul = 1;
  for (int i = 1; i < N; i++) {
    if (!frecv[i].empty()) {
      for (int j = 0; j < frecv[i].size(); j++) {
        v[frecv[i][j]] = cul;
        cul++;
        if (cul == k + 1) cul = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", v[i]);
  }
  return 0;
}
