#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int i, b[5001] = {0};
  pair<int, int> a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    b[a[i].first]++;
  }
  pair<int, int> v[n];
  sort(a, a + n);
  int cl = 0;
  for (i = 0; i < n; i++) {
    if (b[a[i].first] > k) {
      cout << "NO" << '\n';
      return 0;
    }
    cl++;
    cl = cl % k;
    if (cl == 0) {
      v[i].first = a[i].second;
      v[i].second = k;
      cl = 0;
    } else {
      v[i].first = a[i].second;
      v[i].second = cl;
    }
  }
  sort(v, v + n);
  cout << "YES" << '\n';
  for (i = 0; i < n; i++) cout << v[i].second << " ";
}
