#include <bits/stdc++.h>
using namespace std;
int n, k, a[5010], b[5010];
bool v[5010][5010];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), b[a[i]]++;
  for (int i = 1; i <= 5005; i++)
    if (b[i] > k) {
      cout << "NO" << endl;
      return 0;
    }
  for (int i = 1; i <= n; i++) {
    if (i <= k)
      b[i] = i, v[a[i]][i] = 1;
    else
      for (int j = 1; j <= k; j++) {
        if (!v[a[i]][j]) {
          b[i] = j;
          v[a[i]][j] = 1;
          break;
        }
      }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
