#include <bits/stdc++.h>
using namespace std;
const int N = 600;
const double pi = 3.14159265358979323846;
string uppercase(string s) {
  transform(s.begin(), s.end(), s.begin(), ::toupper);
  return s;
}
string lowercase(string s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  return s;
}
const int M = 5e3 + 5;
int freq[M], col[M];
vector<pair<int, int>> v;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int x = 0, n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.emplace_back(x, i);
    freq[x]++;
    if (freq[x] > k) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  sort(v.begin(), v.end());
  for (size_t i = 0; i < n; i++) {
    col[v[i].second] = (i % k) + 1;
  }
  for (size_t i = 0; i < n; i++) printf("%d%c", col[i], " \n"[i == n - 1]);
  return 0;
}
