#include <bits/stdc++.h>
using namespace std;
int A[5003], C[5003];
vector<int> IND[5003];
int main() {
  int n, k;
  cin >> n;
  cin >> k;
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
    IND[A[i]].push_back(i);
  }
  int distinct = 0;
  for (int i = 0; i < 5003; ++i) {
    if (IND[i].size() > k) {
      printf("NO\n");
      return 0;
    }
    if (IND[i].size() > 0) {
      for (int j = 0; j < IND[i].size(); ++j)
        C[IND[i][j]] = (distinct++) % k + 1;
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) printf("%d ", C[i]);
  printf("\n");
  return 0;
}
