Complete function check_numbers()