#include <bits/stdc++.h>
using namespace std;
long long int a[5002];
long long int cnt[5002];
long long int mirror[5002];
set<long long int> st;
set<long long int>::iterator it;
vector<long long int> distinct;
int main(void) {
  long long int t, n, m, i, j, k, x, y, ans, L, num;
  double d;
  bool flag;
  t = 1;
  while (t--) {
    cin >> n >> k;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      cnt[a[i]]++;
      st.insert(a[i]);
    }
    for (it = st.begin(); it != st.end(); ++it) distinct.push_back(*it);
    for (i = 0; i < distinct.size(); i++) {
      if (cnt[distinct[i]] > k) {
        cout << "NO" << endl;
        return 0;
      }
    }
    num = 1;
    for (j = 0; j < distinct.size(); j++) {
      for (i = 1; i <= n; i++) {
        if (num > k) num = 1;
        if (a[i] == distinct[j]) mirror[i] = num++;
      }
    }
    cout << "YES" << endl;
    for (i = 1; i <= n; i++) {
      cout << mirror[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
