#include <bits/stdc++.h>
const long double PI = acos(-1);
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
bool vis[5123][5123] = {0};
bool used[5123] = {0};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long v[n];
  long long ans[n];
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long prior = 1;
  for (long long i = 0; i < n; i++) {
    long long use = -1;
    while (used[prior] && prior <= k) prior++;
    for (long long j = 1; j <= k; j++) {
      if (vis[v[i]][j]) continue;
      use = j;
      break;
    }
    if (use == -1) {
      cout << "NO" << '\n';
      return 0;
    }
    if (!vis[v[i]][prior] && prior <= k) {
      use = prior;
      prior++;
    }
    used[use] = true;
    vis[v[i]][use] = true;
    ans[i] = use;
  }
  if (prior < k) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << '\n';
}
