def is_subsequence(L, M):
    """ Return True if L is a subsequence of M """
    j = 0
    for i in range(len(L)):
        try:
            j = M.index(L[i], j)
        except ValueError:
            return False
    return True