#include <bits/stdc++.h>
using namespace std;
vector<int> v[5005];
void sol() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  int A[n];
  for (int i = 0; i < n; i++) cin >> arr[i], v[arr[i]].push_back(i);
  for (int i = 0; i < n; i++) {
    if (v[arr[i]].size() > k) {
      cout << "NO";
      return;
    }
  }
  int tmp = 1;
  bool vis[5005];
  memset(vis, 0, sizeof(vis));
  int ans[n];
  for (int i = 0; i < n; i++) {
    if (!vis[arr[i]]) {
      for (int j = 0; j < v[arr[i]].size(); j++) {
        ans[v[arr[i]][j]] = tmp;
        tmp = (tmp + 1) % k;
        if (tmp == 0) tmp = k;
      }
      vis[arr[i]] = 1;
    }
  }
  cout << "YES" << '\n';
  for (int 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--) sol();
}
