#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  bool bl = 0;
  map<int, int> mp;
  vector<int> v;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x]++;
    mx = max(mx, mp[x]);
    if (mp[x] > k) bl = 1;
    v.push_back(mp[x]);
  }
  if (bl == 1)
    cout << "NO" << endl;
  else {
    map<int, int> mp2;
    for (int i = 0; i < n; i++) {
      mp2[v[i]]++;
      if (mx == k) break;
      if (mp2[v[i]] > 1) {
        mp2[v[i]]--;
        v[i] = mx + 1;
        mx += 1;
      }
    }
    if (mx < k)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        cout << v[i] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
