#include <bits/stdc++.h>
using namespace std;
long long n, k, a[5500], b[5500], counter[5500], ans[5500];
bool found;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    b[a[i]]++;
    if (b[a[i]] > k) {
      cout << "NO";
      return 0;
    }
    ans[i] = b[a[i]];
    counter[b[a[i]]]++;
  }
  for (int i = 1; i <= k; i++) {
    if (counter[i] == 0) {
      found = false;
      for (int j = 0; j < n; j++) {
        if (counter[ans[j]] > 1) {
          counter[ans[j]]--;
          ans[j] = i;
          counter[ans[j]]++;
          found = true;
          break;
        }
      }
      if (!found) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
}
