#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  map<int, int> m;
  int c[7000][2];
  int a[n + 1];
  int b[n + 1];
  int mx;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
    mx = max(mx, m[a[i]]);
  }
  if (mx > k) {
    cout << "NO" << endl;
    return 0;
  }
  int x = 0;
  for (auto i : m) {
    c[i.first][0] = x;
    x = x + i.second;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cout << (c[a[i]][0] % k) + 1 << " ";
    c[a[i]][0]++;
  }
  return 0;
}
