def isLimitExceed(NFA0Delta, NFA1Delta):
    """Decide if the size of NFA0 and NFA1 exceed the limit.

    Size of NFA0 is denoted as N, and size of NFA1 is denoted as M. If N*N*M exceeds 1000000, return False,
    else return True. If bothNFA is False, then NFA0 should be NFA, and NFA1 should be Transducer. If both NFA is
    True, then NFA0 and NFA1 are both NFAs.

    :param dict NFA0Delta: NFA0's transition Delta
    :param dict NFA1Delta: NFA1's transition Delta
    :rtype: bool"""
    N = 0
    for s in list(NFA0Delta.keys()):
        for s1 in NFA0Delta[s]:
            N += len(NFA0Delta[s][s1])
    M = 0
    for s in list(NFA1Delta.keys()):
        for s1 in NFA1Delta[s]:
            M += len(NFA1Delta[s][s1])
    if N * N * M > 1000000:
        return True
    else:
        return False
