#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, k;
  cin >> n >> k;
  map<long long int, vector<long long int>> m;
  map<long long int, long long int> ans;
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    m[x].push_back(i);
  }
  long long int col = 1;
  long long int f = 0;
  for (auto it : m) {
    if (it.second.size() > k) {
      cout << "NO";
      return;
    }
    for (auto j : it.second) {
      ans[j] = col;
      if (col == k) f = 1;
      col++;
      if (col == k + 1) col = 1;
    }
  }
  if (!f) {
    cout << "NO";
    return;
  }
  cout << "YES" << endl;
  for (long long int i = 1; i <= n; i++) cout << ans[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int T;
  T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
