#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  map<int, int> f;
  for (auto &t : a) cin >> t, f[t]++;
  for (auto &t : f)
    if (t.second > k) {
      cout << "NO\n";
      return 0;
    }
  cout << "YES\n";
  vector<int> col(5001);
  int color = 0;
  for (int i = 1; i <= 5000; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j] == i) {
        col[j] = color++;
        if (color >= k) color = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << col[i] + 1 << " ";
  return 0;
}
