#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 9;
int a[N], c[N];
vector<int> v[N];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v[x].push_back(i);
  }
  int mx = 0;
  for (int i = 1; i <= 5000; i++) {
    int t = 0;
    for (int j = 0; j < v[i].size(); j++) {
      t++;
      if (t > k) {
        cout << "NO";
        return 0;
      }
      c[t]++;
      mx = max(mx, t);
      a[v[i][j]] = t;
    }
  }
  if (mx < k) {
    for (int i = 0; i < n; i++) {
      if (c[a[i]] > 1) {
        c[a[i]]--;
        mx++;
        a[i] = mx;
        c[mx]++;
        if (mx == k) {
          break;
        }
      }
    }
  }
  if (mx < k) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
  return 0;
}
