#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[6666], ans[6666];
set<int> s[6666];
void cloro(int id, int clo) {
  while (s[a[id]].count(clo)) {
    clo++;
    if (clo == k + 1) {
      clo = 1;
    }
  }
  ans[id] = clo;
  s[a[id]].insert(clo);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int now = 1;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    if (s[a[i]].size() == k) {
      cout << "NO" << endl;
      exit(0);
    }
    cloro(i, now);
    now++;
    if (now == k + 1) {
      now = 1;
      flag = true;
    }
  }
  if (!flag && now < k) {
    cout << "NO" << endl;
    exit(0);
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
}
