#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l = 0, pat;
  cin >> n >> k;
  pair<int, int> arr[n];
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
    m[arr[i].first]++;
  }
  for (auto x : m)
    if (x.second > k) {
      cout << "NO";
      l = 1;
      break;
    }
  if (l == 0) {
    int a[n];
    sort(arr, arr + n);
    for (int i = 0; i < n; i++) {
      pat = i % k + 1;
      a[arr[i].second] = pat;
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << a[i] << ' ';
  }
}
