#include <bits/stdc++.h>
using namespace std;
pair<int, int> num[5001];
int cnt[5001];
bool cmp1(pair<int, int> pa, pair<int, int> pb) {
  if (pa.first != pb.first)
    return pa.first < pb.first;
  else
    return pa.second < pb.second;
}
bool cmp2(pair<int, int> pa, pair<int, int> pb) {
  if (pa.second != pb.second)
    return pa.second < pb.second;
  else
    return pa.first < pb.first;
}
int main() {
  int n, k;
  cin >> n >> k;
  int max_cnt = 0;
  for (int i = 0; i < n; i++) {
    int number;
    cin >> number;
    num[i].first = number;
    num[i].second = i;
    cnt[number]++;
    max_cnt = max(max_cnt, cnt[number]);
  }
  if (max_cnt <= k) {
    cout << "YES" << endl;
    sort(num, num + n, cmp1);
    for (int i = 0; i < n; i++) {
      num[i].first = (i % k) + 1;
    }
    sort(num, num + n, cmp2);
    for (int i = 0; i < n; i++) {
      cout << num[i].first << ' ';
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
