#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 2;
int color[5001];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  int n, k;
  cin >> n >> k;
  pair<int, int> arr[n + 1];
  unordered_map<int, int> m;
  int temp[n];
  bool flag = 1;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    m[arr[i].first]++;
    arr[i].second = i;
    if (m[arr[i].first] > k) flag = false;
  }
  if (!flag || k > n) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    color[arr[i].second] = (i) % k + 1;
  }
  for (int i = 0; i < n; i++) cout << color[i] << " ";
}
