#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x, i, cnt, flag = 0, arr[6000], temp, color = 0;
  pair<int, int> p;
  multimap<int, pair<int, int> > m;
  map<int, int> mm;
  cin >> n >> k;
  if (k > n) flag = 1;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    mm[arr[i]] += 1;
    p.first = 0;
    p.second = i;
    m.insert(multimap<int, pair<int, int> >::value_type(arr[i], p));
  }
  for (auto it = mm.begin(); it != mm.end(); it++) {
    if ((*it).second > k) {
      flag = 1;
      break;
    }
  }
  if (flag) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    color = 0;
    for (auto it = m.begin(); it != m.end(); it++) {
      (*it).second.first = color % k + 1;
      color++;
    }
    for (auto it = m.begin(); it != m.end(); it++) {
      arr[(*it).second.second] = (*it).second.first;
    }
    cout << arr[0];
    for (i = 1; i < n; i++) cout << " " << arr[i];
  }
  return 0;
}
