#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using uLL = unsigned long long;
int close_sycn = (ios::sync_with_stdio(false), cin.tie(0), 0);
constexpr int N = 5005;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n), cnt(N);
  for (auto &x : a) {
    cin >> x;
    cnt[x]++;
  }
  if (*max_element(cnt.begin(), cnt.end()) > k) {
    cout << "NO\n";
    exit(0);
  }
  cout << "YES\n";
  vector<set<int>> s(N);
  for (int i = 0; i < k; i++) {
    cout << i + 1 << ' ';
    s[a[i]].insert(i + 1);
  }
  auto fun = [&](set<int> &s) {
    int b = 1;
    for (auto &x : s) {
      if (b != x) break;
      b++;
    }
    return b;
  };
  for (int i = k; i < n; i++) {
    int t = fun(s[a[i]]);
    cout << t << ' ';
    s[a[i]].insert(t);
  }
  cout << '\n';
  return 0;
}
