#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long INFl = 1e18;
vector<int> pos[5005];
int n, k;
int tab[5005];
bool bylo[5005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    pos[x].push_back(i);
  }
  int cnt = 1;
  for (int i = 1; i <= 5000; i++) {
    if (pos[i].size() > k) {
      cout << "NO\n";
      return 0;
    }
    for (auto it : pos[i]) {
      tab[it] = cnt % k + 1;
      bylo[cnt % k + 1] = true;
      cnt++;
    }
  }
  for (int i = 1; i <= k; i++) {
    if (!bylo[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << tab[i] << ' ';
  return 0;
}
