#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  map<int, vector<int> > M;
  for (int i = 0; i < (int)n; i++) {
    int x;
    cin >> x;
    M[x].push_back(i);
  }
  if (n < k) {
    cout << "NO\n";
    return 0;
  }
  int v[n];
  int cor = 0;
  for (auto i = M.begin(); i != M.end(); ++i) {
    if (int((i->second).size()) > k) {
      cout << "NO\n";
      return 0;
    }
    for (int j = 0; j < (int)int((i->second).size()); j++) {
      v[i->second[j]] = cor++;
      if (cor == k) cor = 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < (int)n; i++) cout << v[i] + 1 << " ";
  cout << "\n";
}
