Function to check if it is possible to choose X and Y elements from a and b such that maximum element among X element is less than minimum element among Y elements
function check ( a , b , Na , Nb , k , m ) {