For this Question: You had written M <b>identical</b> strings each of length N on a whiteboard. Your archenemy came to the classroom behind your back and erased all the M strings and replaced those M strings with a single string of length M*N. He confesses that he simply jumbled all the M strings into one. But you doubt him, so you want to check whether he is telling the truth.The first line of the input contains 2 integers N and M.
The next line contains a string of length N*M.
Constraints:
1 <= N*M <= 10<sup>5</sup>
A string of length N*M having lowercase english alphabets.Print "YES" if your friend is telling the truth, else print "NO".Sample Input:
3 2
abccab

Sample Output:
YES

Explaination:
You had written string "abc" twice one the board which when shuffled gives string abccab., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {
    Scanner sc= new Scanner(System.in);
    int n= sc.nextInt();
    int m= sc.nextInt();
    String s= sc.next();

    System.out.println(checkstring(n,m, s));
    }
    public static String checkstring(int n, int m, String str){
        if(str.length()!=m*n) return "NO";
        else {

            HashMap<Character, Integer> map = new HashMap<>();
            for(int i=0;i<str.length();i++){
                char c= str.charAt(i);

                map.put(c, map.getOrDefault(c,0)+1);

                    }

        for(Character ch : map.keySet()){
            if(map.get(ch)%m!=0 ) return "NO";
        }
        return "YES";
    }

    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?