def is_gp(l):
    """
    Calculates the log of the sequence and checks if this is an AP
    @arg l  The list to check
    @ret    Boolean
    """
    if len(l) < 2:
        return True
    for i in range(len(l) - 2):
        if l[i] * l[i + 2] != l[i + 1] ** 2:
            return False
    for i in range(len(l) - 1):
        if l[i] == 0 and l[i + 1] != 0:
            return False
    return True
