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

edge= [[] for i in range(N+1)]

for i in range(M):

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

    edge[a].append(b)

    edge[b].append(a)



result = []



import copy

def dfs(n,used,d):

    if d == N-1:

        result.append(1)

    for e in edge[n]:

        if used[e] == False:

            usedf = copy.deepcopy(used)

            usedf[e] = True

            dfs(e,usedf,d+1)





used = [False]*(N+1)

used[1] = True

dfs(1,used,0)

print((len(result)))

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

edge= [[] for i in range(N+1)]

for i in range(M):

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

    edge[a].append(b)

    edge[b].append(a)



import itertools

per = itertools.permutations([i for i in range(1,N+1)])

ans = 0

for item in per:

    if item[0] != 1:

        continue

    f = True

    for ind,num in enumerate(item):

        if ind + 1<= N-1:

            nnum = item[ind+1]

            if nnum not in edge[num]:

                f = False



    if f:

        ans += 1



print(ans)

N, M = list(map(int, input().split()))
edge = [[] for i in range(N + 1)]
for i in range(M):
    a, b = list(map(int, input().split()))
    edge[a].append(b)
    edge[b].append(a)
result = []
import copy


def dfs(n, used, d):
    if d == N - 1:
        result.append(1)
    for e in edge[n]:
        if used[e] == False:
            usedf = copy.deepcopy(used)
            usedf[e] = True
            dfs(e, usedf, d + 1)


used = [False] * (N + 1)
used[1] = True
dfs(1, used, 0)
print((len(result)))

N, M = list(map(int, input().split()))
edge = [[] for i in range(N + 1)]
for i in range(M):
    a, b = list(map(int, input().split()))
    edge[a].append(b)
    edge[b].append(a)
import itertools

per = itertools.permutations([i for i in range(1, N + 1)])
ans = 0
for item in per:
    if item[0] != 1:
        continue
    f = True
    for ind, num in enumerate(item):
        if ind + 1 <= N - 1:
            nnum = item[ind + 1]
            if nnum not in edge[num]:
                f = False
    if f:
        ans += 1
print(ans)

-result = [] -import copy +import itertools - -def dfs(n, used, d): -    if d == N - 1: -        result.append(1) -    for e in edge[n]: -        if used[e] == False: -            usedf = copy.deepcopy(used) -            usedf[e] = True -            dfs(e, usedf, d + 1) - - -used = [False] * (N + 1) -used[1] = True -dfs(1, used, 0) -print((len(result))) +per = itertools.permutations([i for i in range(1, N + 1)]) +ans = 0 +for item in per: +    if item[0] != 1: +        continue +    f = True +    for ind, num in enumerate(item): +        if ind + 1 <= N - 1: +            nnum = item[ind + 1] +            if nnum not in edge[num]: +                f = False +    if f: +        ans += 1 +print(ans)