------
## 最终结论
```python
def is_valid_serialization(preorder: str) -> bool:
    slots = 1  # Start with one slot for the root node
    nodes = preorder.split(',')
    
    for node in nodes:
        slots -= 1  # One slot is used for the current node
        if slots < 0:  # If we run out of slots, it's invalid
            return False
        if node != '#':  # If it's not a null node, we add two new slots
            slots += 2
            
    return slots == 0  # All slots should be used up at the end

# Example usage:
print(is_valid_serialization("9,3,4,#,#,1,#,#,2,#,6,#,#"))  # Output: True
print(is_valid_serialization("1,#"))                         # Output: False
print(is_valid_serialization("9,#,#,1"))                     # Output: False
```