```python
from typing import *
from collections import *

def time_gap(from_hour: int, from_minute: int, to_hour: int, to_minute: int) -> int:
    """
    Calculate the number of minutes from the first time to the second time, taking the second time as falling on the following day if it is not later than the first.
    
    Args:
    from_hour (int): The hour of the first time.
    from_minute (int): The minute of the first time.
    to_hour (int): The hour of the second time.
    to_minute (int): The minute of the second time.
    
    Returns:
    int: The number of minutes between the two times.
    
    Examples:
    >>> time_gap(10, 30, 14, 45)
    15
    >>> time_gap(23, 59, 0, 1)
    60
    >>> time_gap(12, 0, 12, 0)
    0
    """
    # Handle the case where to_hour is later than from_hour
    if to_hour < from_hour:
        return (24 - from_hour) * 60 + to_minute - from_minute
    else:
        return to_minute - from_minute

# Check function with provided data points
def check_time_gap():
    assert time_gap(10, 30, 14, 45) == 15
    assert time_gap(23, 59, 0, 1) == 60
    assert time_gap(12, 0, 12, 0) == 0
    assert time_gap(18, 30, 9, 45) == 30
    assert time_gap(1, 1, 2, 0) == 60
    print("All checks passed.")

check_time_gap()
```