#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n >> k;     int a[n];     int count[5005] = {0};     for (int i = 0; i < n; i++) {       cin >> a[i];       count[a[i]]++;     }     int c[n];     int d = 1;     for (int i = 1; i <= 5000; i++) {       if (count[i] > k) {         cout <<  NO               <<   n ;         return 0;       }     }     cout <<  YES           <<   n ;     if (k == 1) {       for (int i = 0; i < n; i++) {         cout <<  1               <<    ;       }     } else {       for (int i = 1; i <= 5000; i++) {         for (int j = 0; j < n; j++) {           if (a[j] == i) {             c[j] = d;             d++;           }           if (d > k) d = d % k;         }       }       for (int i = 0; i < n; i++) {         cout << c[i] <<    ;       }     }   }   