#include <bits/stdc++.h>
using namespace std;
long long mult(long long a, long long b, long long p = 1000000007) {
  return ((a % p) * (b % p)) % p;
}
long long add(long long a, long long b, long long p = 1000000007) {
  return (a % p + b % p) % p;
}
long long sub(long long a, long long b, long long p = 1000000007) {
  return (a % p - b % p + p) % p;
}
long long fpow(long long n, long long k, long long p = 1000000007) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = mult(r, n, p);
    n = mult(n, n, p);
  }
  return r;
}
long long inv(long long a, long long p = 1000000007) {
  return fpow(a, p - 2, p);
}
map<long long, vector<long long> > m;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n], c[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]].push_back(i);
  }
  bool f = 1;
  long long mx = 1;
  long long it = 1;
  for (auto i : m) {
    if (i.second.size() > k) f = 0;
    for (auto j : i.second) {
      c[j] = it;
      mx = max(mx, it);
      ++it;
      if (it > k) {
        it = 1;
        mx = k;
      }
    }
  }
  if (f && mx == k) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << c[i] << " ";
  } else
    cout << "NO\n";
}
