#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, count(0);
  cin >> n >> k;
  vector<int> v(n), ans(n);
  vector<int> temp(5001);
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int i = 0; i < n; ++i) {
    ++temp[v[i]];
    if (temp[v[i]] > k) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 1; i <= k; ++i) {
    vector<int> used(5001);
    bool ext(0);
    for (int j = 0; j < n; ++j) {
      if (!used[v[j]] && !ans[j]) {
        ans[j] = i;
        used[v[j]] = 1;
        ++count;
        if (n - count == k - i) {
          count = i + 1;
          ext = 1;
          break;
        }
      }
    }
    if (ext) break;
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    if (!ans[i]) {
      ans[i] = count;
      ++count;
    }
    cout << ans[i] << ' ';
  }
  return 0;
}
