#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long n, k;
    cin >> n >> k;
    vector<pair<long long int, long long int> > v(n);
    long long temp;
    for (long long int i = 0; i < n; i++) {
      cin >> v[i].first;
      v[i].second = i;
    }
    sort((v).begin(), (v).end());
    long long cnt = 1;
    long long mcnt = 0;
    for (long long int i = 1; i < n; i++) {
      if (v[i].first != v[i - 1].first) {
        if (cnt > mcnt) mcnt = cnt;
        cnt = 1;
      } else
        cnt++;
    }
    if (cnt > mcnt) mcnt = cnt;
    if (mcnt > k)
      cout << "NO" << '\n';
    else {
      cout << "YES" << '\n';
      vector<long long int> x(n);
      long long i = 1;
      for (long long int j = 0; j < n; j++) {
        x[v[j].second] = i;
        i++;
        if (i == k + 1) i = 1;
      }
      for (long long int i = 0; i < n - 1; i++) cout << x[i] << " ";
      cout << x[n - 1];
    }
  }
  return 0;
}
