#include <bits/stdc++.h>
using namespace std;
const int lx = 3e5 + 123;
const long long int mod = 1e9 + 7;
void solve() {
  int n, i, j, k, l, f = 0, c, clr = 1, b, y = 0;
  cin >> n >> c;
  int a[n];
  vector<pair<int, int> > v(n);
  for (i = 0; i < n; i++) {
    cin >> k;
    v[i].first = k;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  for (i = 0; i < n;) {
    l = i;
    k = 0;
    while (i < n && v[i].first == v[l].first) i++, k++;
    if (k > c) {
      f++;
      break;
    }
    b = clr;
    for (j = l; j < i; j++) {
      if (clr > c) {
        y++;
        clr = 1;
      }
      if (clr == c) y++;
      a[v[j].second] = clr++;
    }
  }
  if (f || !y)
    cout << "NO"
         << "\n";
  else {
    cout << "YES"
         << "\n";
    for (i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
}
void init_code() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
