#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  int n, k;
  while (cin >> n >> k) {
    vector<int> V[5005];
    for (int i = 1; i <= n; i++) {
      int tmp;
      cin >> tmp;
      V[tmp].push_back(i);
    }
    int mx = 0;
    for (int i = 1; i <= 5000; i++) {
      mx = mx > V[i].size() ? mx : V[i].size();
    }
    if (mx > k || n < k) {
      cout << "NO" << endl;
      continue;
    } else {
      queue<int> Q;
      int tmp = 1;
      while (Q.size() < n) {
        for (int i = 0; i < V[tmp].size(); i++) {
          Q.push(V[tmp][i]);
        }
        tmp++;
      }
      int ans[5005];
      int f = 0;
      while (Q.empty() == 0) {
        int t = Q.front();
        Q.pop();
        ans[t] = ++f;
        if (f == k) f = 0;
      }
      for (int i = tmp; i <= 5000; i++) {
        for (int j = 0; j < V[i].size(); j++) {
          ans[V[i][j]] = j + 1;
        }
      }
      cout << "YES" << endl;
      for (int i = 1; i <= n; i++) {
        cout << ans[i] << " ";
      }
      cout << endl;
    }
  }
}
