def isinvalid(actual, sub):
    """
    Checks if submitted route is invalid.
    Parameters
    ----------
    actual : list
        Actual route.
    sub : list
        Submitted route.
    Returns
    -------
    bool
        True if route is invalid. False otherwise.
    """
    if len(actual) != len(sub) or set(actual) != set(sub):
        return True
    elif actual[0] != sub[0]:
        return True
    else:
        return False