func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 10;   bool is_Prime(long long a) {     for (long long i = 2; i * i <= a; ++i)       if (a % i == 0) return false;     return true;   }   bool cmp(pair<long long, long long> a, pair<long long, long long> b) {     return (a.second < b.second);   }   long long fact(long long n) {     vector<long long> v;     for (long long i = 2; i * i <= n; i++) {       if (n % i == 0) {         if (n / i == i)           v.push_back(i);         else {           v.push_back(i);           v.push_back(n / i);         }       }     }     return v.size();   }   void C(long long n, long long r) {     vector<vector<long long>> c(n + 1, vector<long long>(r + 1, 0));     for (long long i = 0; i < n + 1; i++) {       for (long long j = 0; j <= i && j <= r; j++)         if (j == 0 || j == i)           c[i][j] = 1;         else           c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;     }   }   bool is_pl(string s, int n) {     for (long long i = 0; i < n / 2; i++) {       if (s[i] != s[n - i - 1]) return false;     }     return true;   }   void solve() {     int n, k;     cin >> n >> k;     int cnt[5001] = {0};     vector<pair<int, int>> v(n);     for (long long i = 0; i < n; i++) {       cin >> v[i].first;       cnt[v[i].first]++;       v[i].second = (int)i;     }     for (long long i = 0; i < 5001; i++) {       if (cnt[i] > k) {         cout <<  NO n ;         return;       }     }     sort(v.begin(), v.end());     vector<int> ans(n);     int a = 1;     for (long long i = 0; i < n; i++) {       ans[v[i].second] = a;       a++;       if (a > k) a = 1;     }     cout <<  YES n ;     for (long long i = 0; i < n; i++) cout << ans[i] <<    ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0), cout.tie(0);     ;     int T = 1;     while (T--) {       solve();     }     return 0;   }   