import itertools

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

ab=list(list(map(int,input().split())) for _ in range(M))

l=list(l for l in range(1,N+1))

numlist=list(itertools.permutations(l))

ans=0

for I in numlist:

    if I[0]==1 and all(sorted([I[j],I[j+1]]) in ab for j in range(N-1)):

        ans+=1

print(ans)

import itertools

n, m = list(map(int, input().split()))

path = [[False] * n for i in range(n)]



for i in range(m):

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

    a -= 1

    b -= 1

    path[a][b] = True

    path[b][a] = True

ans = 0



for i in itertools.permutations(list(range(n)), n):

    if i[0] == 0:

        for j in range(n):

            if j == n - 1:

                ans += 1

                break

            if not path[i[j]][i[j + 1]]:

                break

print(ans)
import itertools

N, M = list(map(int, input().split()))
ab = list(list(map(int, input().split())) for _ in range(M))
l = list(l for l in range(1, N + 1))
numlist = list(itertools.permutations(l))
ans = 0
for I in numlist:
    if I[0] == 1 and all(sorted([I[j], I[j + 1]]) in ab for j in range(N - 1)):
        ans += 1
print(ans)

import itertools

n, m = list(map(int, input().split()))
path = [[False] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True
ans = 0
for i in itertools.permutations(list(range(n)), n):
    if i[0] == 0:
        for j in range(n):
            if j == n - 1:
                ans += 1
                break
            if not path[i[j]][i[j + 1]]:
                break
print(ans)

-N, M = list(map(int, input().split())) -ab = list(list(map(int, input().split())) for _ in range(M)) -l = list(l for l in range(1, N + 1)) -numlist = list(itertools.permutations(l)) +n, m = list(map(int, input().split())) +path = [[False] * n for i in range(n)] +for i in range(m): +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    path[a][b] = True +    path[b][a] = True -for I in numlist: -    if I[0] == 1 and all(sorted([I[j], I[j + 1]]) in ab for j in range(N - 1)): -        ans += 1 +for i in itertools.permutations(list(range(n)), n): +    if i[0] == 0: +        for j in range(n): +            if j == n - 1: +                ans += 1 +                break +            if not path[i[j]][i[j + 1]]: +                break