Check if input is in the desired range