Converts Binary number into its Decimal equivalent

ALso checks if input is binary