Function to check if an input is a number.