#include <bits/stdc++.h>
using namespace std;
void swap(int &a, int &b) {
  int temp = a;
  a = b;
  b = temp;
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> arr(n);
  vector<int> ans(n);
  unordered_map<int, vector<int>> umap;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    umap[arr[i]].push_back(i);
  }
  int c = 1;
  for (auto it = umap.begin(); it != umap.end(); ++it) {
    if (it->second.size() > k) {
      cout << "NO\n";
      return;
    }
    for (int i = 0; i < it->second.size(); ++i) {
      if (c == k + 1) c = 1;
      ans[it->second[i]] = c++;
    }
  }
  cout << "YES\n";
  for (int i : ans) cout << i << " ";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
