#include <bits/stdc++.h>   using namespace std;   bool cmp(pair<long long int, long long int> pa1,            pair<long long int, long long int> pa2) {     return pa1.second < pa2.second;   }   int main() {     long long int n, k, i, mn, cnt;     cin >> n >> k;     long long int a[5001];     for (i = 0; i < n; i++) cin >> a[i];     long long int has[5001] = {0};     for (i = 0; i < n; i++) {       has[a[i]]++;     }     mn = *max_element(has, has + 5001);     if (mn <= k && k <= n) {       cout <<  YES n ;       pair<long long int, long long int> pa[5001];       for (i = 0; i < n; i++) {         pa[i].first = a[i];         pa[i].second = i;       }       sort(pa, pa + n);       cnt = 1;       for (i = 0; i < n; i++) {         pa[i].first = cnt;         cnt++;         if (cnt == k + 1) cnt = 1;       }       sort(pa, pa + n, cmp);       for (i = 0; i < n; i++) cout << pa[i].first <<    ;     } else       cout <<  NO ;   }   