Â
import java.util.*;
public magnificence GFG {
 Â
   Â
    public static void primary(String[] args)
    {
 Â
       Â
        String str = "akmzaxazmk";
        int Okay = 6;
 Â
       Â
        AlterString(str, Okay);
    }
 Â
   Â
   Â
   Â
    static void AlterString(String str, int Okay)
    {
 Â
       Â
       Â
        boolean flag = true;
 Â
       Â
       Â
        HashMap<Persona, Integer> map = new HashMap<>();
 Â
       Â
        for (int i = 0; i < str.duration(); i++) {
 Â
           Â
           Â
           Â
           Â
           Â
            if (map.containsKey(str.charAt(i))) {
                int finish = map.get(str.charAt(i));
                if ((finish - i) % 2 == 0) {
                    proceed;
                }
                else {
                    flag = false;
                    destroy;
                }
            }
 Â
           Â
           Â
           Â
           Â
           Â
            else {
                map.put(str.charAt(i), i);
            }
        }
 Â
       Â
       Â
       Â
        if (flag && map.measurement() <= Okay) {
            Device.out.println("YES");
            for (Map.Access<Persona, Integer> set :
                 map.entrySet()) {
                Device.out.println(
                    " " + set.getKey() + " : "
                    + ((set.getValue() % 2 == 0) ? 0 : 1));
            }
        }
        else {
            Device.out.println("NO");
        }
    }
}