#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, long long> C;
  vector<pair<long long, long long>> B;
  long long n, k, m = 0, v = 1;
  cin >> n >> k;
  long long A[n], D[n];
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    B.push_back(make_pair(A[i], i));
    C[A[i]]++;
  }
  sort(B.begin(), B.end());
  for (auto it = C.begin(); it != C.end(); it++) {
    m = max(m, it->second);
  }
  if (m > k)
    cout << "NO" << '\n';
  else {
    cout << "YES" << '\n';
    for (long long i = 0; i < n; i++) {
      if (v % k != 0)
        D[B[i].second] = v % k;
      else
        D[B[i].second] = k;
      v++;
    }
    for (long long i = 0; i < n; i++) cout << D[i] << ' ';
    cout << '\n';
  }
  return 0;
}
