#include <bits/stdc++.h>
using namespace std;
long long sqr(long long x) { return x * x; }
long double sqrd(long double x) { return x * x; }
mt19937 Random((int)time(0));
long long rnd(long long x) { return Random() % x; }
const long long INF = (long long)1e9 + 282;
const long long MOD = (long long)1e9 + 7;
const long double PI = acosl(-1.0);
const int N = 5010;
int cnt[N], ans[N];
vector<int> w[N];
void mane() {
  int n, m;
  cin >> n >> m;
  int res = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ans[i] = ++cnt[a];
    if (cnt[a] > m) {
      cout << "NO";
      return;
    }
    res = max(res, cnt[a]);
    w[cnt[a]].push_back(i);
  }
  if (res < m) {
    for (int i = 0; i < N; i++) {
      for (int j = 1; j < (int)(w[i]).size() && res < m; j++) {
        ans[w[i][j]] = ++res;
      }
    }
  }
  if (res < m) {
    cout << "NO";
    return;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios_base::fixed, ios_base::floatfield);
  cout.precision(12);
  mane();
}
