#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int inc(int x, int k) {
  if (x < k) {
    return ++x;
  }
  return 1;
}
int main() {
  int n, k;
  cin >> n >> k;
  int ar[n];
  int col[n];
  int q = 1;
  unordered_map<int, vector<int> > umap;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    umap[ar[i]].push_back(i);
  }
  bool fl = 1;
  for (auto x : umap) {
    fl = x.second.size() <= k;
    if (!fl) {
      break;
    }
    for (auto xx : x.second) {
      col[xx] = q;
      q = inc(q, k);
    }
  }
  if (fl) {
    cout << "YES\n";
    for (auto x : col) {
      cout << x << " ";
    }
    cout << "\n";
  } else {
    cout << "NO\n";
  }
}
