#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<pair<int, int>> arr(n);
    vector<int> counts(5001, 0);
    string ans = "YES";
    for (int i = 0; i < n; i++) {
      cin >> arr[i].first;
      counts[arr[i].first]++;
      if (counts[arr[i].first] > k) ans = "NO";
      arr[i].second = i;
    }
    cout << ans << "\n";
    if (ans == "YES") {
      sort(arr.begin(), arr.end());
      vector<int> col(n);
      int count = 1;
      for (int i = 0; i < n; i++) {
        col[arr[i].second] = count;
        count++;
        if (count == k + 1) count = 1;
      }
      for (int i = 0; i < n; i++) {
        cout << col[i] << " ";
      }
    }
  }
}
