#include <bits/stdc++.h>
using namespace std;
int n, k, ara[6000], arra[6000], color;
bool ok;
int main() {
  cin >> n >> k;
  color = 1;
  ok = true;
  for (int i = 0; i < n; i++) {
    cin >> ara[i];
  }
  for (int i = 1; i <= 5000; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (ara[j] == i) {
        arra[j] = color++;
        count++;
        if (color > k) color = 1;
      }
      if (count > k) {
        ok = false;
        break;
      }
    }
  }
  if (!ok)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << arra[i] << " ";
    }
    cout << endl;
  }
}
