from typing import Union


def to_hours(num_ts: Union[str, list, int, float]) -> Union[str, list]:
    """
    Convert YAML input to hours

    Args:
        num_ts: list of number in YMAL file, e.g., 900, 1700, etc.

    Returns:
        str

    Examples:
        >>> to_hours([900, 1700])
        ['09:00', '17:00']
        >>> to_hours(901)
        '09:01'
        >>> to_hours('XYZ')
        'XYZ'
    """
    if isinstance(num_ts, str): return num_ts
    if isinstance(num_ts, (int, float)):
        return f'{int(num_ts / 100):02d}:{int(num_ts % 100):02d}'
    return [to_hours(num) for num in num_ts]