------
## 最终结论
```python
def num_ways_to_split(s):
    MOD = 10**9 + 7

    # Step 1: Count total number of '1's in the string
    total_ones = s.count('1')

    # Step 2: If total_ones is not divisible by 3, return 0
    if total_ones % 3 != 0:
        return 0

    # Step 3: Calculate ones_per_part
    ones_per_part = total_ones // 3

    # Edge case for all zeros
    if ones_per_part == 0:
        n = len(s)
        return ((n - 1) * (n - 2) // 2) % MOD

    # Step 4: Traverse the string to find split points
    first_split_count = second_split_count = current_ones = 0
    for char in s:
        if char == '1':
            current_ones += 1
        
        if current_ones == ones_per_part:
            first_split_count += 1
        elif current_ones == 2 * ones_per_part:
            second_split_count += 1
    
    # Step 5: Calculate the result using split counts
    return (first_split_count * second_split_count) % MOD

# Example usage:
s1 = "10101"
print(num_ways_to_split(s1))  # Output: 4

s2 = "1001"
print(num_ways_to_split(s2))  # Output: 0

s3 = "0000"
print(num_ways_to_split(s3))  # Output: 3

s4 = "100100010100110"
print(num_ways_to_split(s4))  # Output: 12
```