N, M = list(map(int, input().split()))

P = [list(map(int, input().split())) for k in range(M)]

G = [[0 for k in range(N)] for k in range(N)]

for p in P:

    G[p[0]-1][p[1]-1] = G[p[1]-1][p[0]-1] = 1



def dfs(ima,itta):

    if len(itta)==N:

        return 1

    ans = 0

    for k in range(N):

        if ima[k]==1 and k not in itta:

            itta.append(k)

            ans += dfs(G[k],itta)

            itta.remove(k)

    return ans



print((dfs(G[0],[0])))

N, M = list(map(int,input().split()))

G = [[] for k in range(N)]



for k in range(M):

    a, b = list(map(int,input().split()))

    G[a-1].append(b-1)

    G[b-1].append(a-1)



def dfs(ima,visited):

    global ans

    visited[ima] = 1

    for tsugi in G[ima]:

        if visited[tsugi] == 0:

            visited[tsugi] = 1

            if sum(visited) == N:

                ans += 1

            dfs(tsugi,visited)

            visited[tsugi] = 0

ans = 0

dfs(0,[0]*N)

print(ans)

N, M = list(map(int, input().split()))
P = [list(map(int, input().split())) for k in range(M)]
G = [[0 for k in range(N)] for k in range(N)]
for p in P:
    G[p[0] - 1][p[1] - 1] = G[p[1] - 1][p[0] - 1] = 1


def dfs(ima, itta):
    if len(itta) == N:
        return 1
    ans = 0
    for k in range(N):
        if ima[k] == 1 and k not in itta:
            itta.append(k)
            ans += dfs(G[k], itta)
            itta.remove(k)
    return ans


print((dfs(G[0], [0])))

N, M = list(map(int, input().split()))
G = [[] for k in range(N)]
for k in range(M):
    a, b = list(map(int, input().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)


def dfs(ima, visited):
    global ans
    visited[ima] = 1
    for tsugi in G[ima]:
        if visited[tsugi] == 0:
            visited[tsugi] = 1
            if sum(visited) == N:
                ans += 1
            dfs(tsugi, visited)
            visited[tsugi] = 0


ans = 0
dfs(0, [0] * N)
print(ans)

-P = [list(map(int, input().split())) for k in range(M)] -G = [[0 for k in range(N)] for k in range(N)] -for p in P: -    G[p[0] - 1][p[1] - 1] = G[p[1] - 1][p[0] - 1] = 1 +G = [[] for k in range(N)] +for k in range(M): +    a, b = list(map(int, input().split())) +    G[a - 1].append(b - 1) +    G[b - 1].append(a - 1) -def dfs(ima, itta): -    if len(itta) == N: -        return 1 -    ans = 0 -    for k in range(N): -        if ima[k] == 1 and k not in itta: -            itta.append(k) -            ans += dfs(G[k], itta) -            itta.remove(k) -    return ans +def dfs(ima, visited): +    global ans +    visited[ima] = 1 +    for tsugi in G[ima]: +        if visited[tsugi] == 0: +            visited[tsugi] = 1 +            if sum(visited) == N: +                ans += 1 +            dfs(tsugi, visited) +            visited[tsugi] = 0 -print((dfs(G[0], [0]))) +ans = 0 +dfs(0, [0] * N) +print(ans)