#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, K;
  cin >> n >> K;
  map<int, vector<int>> mp;
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    mp[v].push_back(i);
    if (mp[v].size() > K) {
      cout << "NO" << endl;
      exit(0);
    }
  }
  int cnt = 0;
  for (auto [k, v] : mp) {
    for (auto d : v) {
      ans[d] = cnt + 1;
      cnt = (cnt + 1) % K;
    }
  }
  cout << "YES" << endl;
  for (auto x : ans) {
    cout << x << " ";
  }
  return 0;
}
