checks if number is balanced