#include <bits/stdc++.h>
using namespace std;
int mp[5005];
int main() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = make_pair(x, i);
    mp[x]++;
    if (mp[x] > k) {
      cout << "NO" << endl;
      return 0;
    }
  }
  sort(a.begin(), a.end());
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    ans[a[i].second] = i % k + 1;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}
