#include <bits/stdc++.h>
using namespace std;
void pv(vector<long long int> arr, long long int size) {
  for (long long int i = 0; i < size; i++) {
    cout << arr[i] << ' ';
  }
}
void gv(vector<long long int> &arr) {
  long long int size = arr.size();
  for (long long int i = 0; i < size; i++) {
    cin >> arr[i];
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k, c = 1;
  cin >> n >> k;
  vector<long long int> arr(n), ans(n, 0);
  gv(arr);
  for (long long int i = 0; i < n; i++) {
    if (ans[i] == 0) {
      ans[i] = c++;
      if (c == k + 1) c = 1;
      for (long long int j = i + 1; j < n; j++) {
        if (arr[i] == arr[j]) {
          ans[j] = c++;
        }
        if (c == k + 1) c = 1;
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      if (arr[i] == arr[j] && ans[i] == ans[j]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (long long int i = 0; i < n; i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
