#include <bits/stdc++.h>
using namespace std;
deque<long long int> d;
vector<long long int> v1;
map<long long int, long long int> m;
vector<pair<long long int, long long int> > v;
long long int i, j, n, p, q, a, k, t;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  long long int b[n];
  for (i = 0; i < n; i++) {
    cin >> a;
    v.push_back(make_pair(a, i));
    m[a]++;
    p = max(p, m[a]);
  }
  sort(v.begin(), v.end());
  b[v[0].second] = 1;
  if (p > k)
    cout << "NO";
  else {
    cout << "YES" << endl;
    for (i = 1; i < n; i++) {
      t = v[i].second;
      q = v[i - 1].second;
      if (b[q] == k) {
        b[t] = 1;
      } else
        b[t] = b[q] + 1;
    }
    for (i = 0; i < n; i++) cout << b[i] << ' ';
  }
}
