def is_ugly(num, factors=(2, 3, 5)):
    """
    Check whether a given number is an ugly number

    :param num: given number
    :type num: int
    :param factors: prime factors for ugly number
    :type factors: list[int] or tuple[int]
    :return: whether a given number is an ugly number
    :rtype: bool
    """
    if num == 1:
        return True
    elif num <= 0:
        return False

    for factor in factors:
        while num % factor == 0:
            num //= factor
    return num == 1