#include <bits/stdc++.h>
using namespace std;
long long oo = 1000000000000000000;
int n, k;
int ans[5005];
vector<int> cnt[5005];
vector<int> a;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int in;
    cin >> in;
    if (cnt[in].empty()) a.push_back(in);
    cnt[in].push_back(i);
  }
  int tk = 1;
  bool ch = true;
  for (auto in : a) {
    if (cnt[in].size() > k) {
      ch = false;
      break;
    }
    for (auto idx : cnt[in]) {
      ans[idx] = tk++;
      if (tk == k + 1) tk = 1;
    }
  }
  if (!ch)
    cout << "NO";
  else {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  }
  return 0;
}
