def check_loop_validity(inst_list):
    """ Given a list of instructions, check whether they can form a valid loop.
    This means, checking for anything that could create an infinite loop.
    We are also disallowing double loops right now"""

    for i, c in enumerate(inst_list):
        if c in [5, 6, 16, 25]:
            return False, i
    return True, -1