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

e=[[]for _ in[0]*-~n]

for _ in[0]*m:

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

    e[a]+=[b]

    e[b]+=[a]

candy=[[1]]

for _ in[0]*~-n:

    tmp=[]

    for c in candy:

        for next in e[c[-1]]:

            tmp+=[c+[next]]

    candy=tmp

print((sum(c==set(range(1,n+1))for c in map(set,candy))))
from itertools import permutations



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

edges = set()

for _ in range(M):

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

    edges.add((a, b))

    edges.add((b, a))



cnt = 0

for p in permutations(list(range(2, N + 1))):

    cnt += all(move in edges for move in zip((1,) + p, p))

print(cnt)
n, m = list(map(int, input().split()))
e = [[] for _ in [0] * -~n]
for _ in [0] * m:
    a, b = list(map(int, input().split()))
    e[a] += [b]
    e[b] += [a]
candy = [[1]]
for _ in [0] * ~-n:
    tmp = []
    for c in candy:
        for next in e[c[-1]]:
            tmp += [c + [next]]
    candy = tmp
print((sum(c == set(range(1, n + 1)) for c in map(set, candy))))

from itertools import permutations

N, M = list(map(int, input().split()))
edges = set()
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.add((a, b))
    edges.add((b, a))
cnt = 0
for p in permutations(list(range(2, N + 1))):
    cnt += all(move in edges for move in zip((1,) + p, p))
print(cnt)

-n, m = list(map(int, input().split())) -e = [[] for _ in [0] * -~n] -for _ in [0] * m: +from itertools import permutations + +N, M = list(map(int, input().split())) +edges = set() +for _ in range(M): -    e[a] += [b] -    e[b] += [a] -candy = [[1]] -for _ in [0] * ~-n: -    tmp = [] -    for c in candy: -        for next in e[c[-1]]: -            tmp += [c + [next]] -    candy = tmp -print((sum(c == set(range(1, n + 1)) for c in map(set, candy)))) +    edges.add((a, b)) +    edges.add((b, a)) +cnt = 0 +for p in permutations(list(range(2, N + 1))): +    cnt += all(move in edges for move in zip((1,) + p, p)) +print(cnt)