# -*- coding: utf-8 -*-



from collections import deque



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

Ms = {i:set() for i in range(1, N + 1)}

for _ in range(M):

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

    Ms[a].add(b)

    Ms[b].add(a)



all = set(range(1, N + 1))

q = deque()

q.append((1, [1]))



ans = 0

while q:

    n, v = q.popleft()

    if set(v) == all:

        ans += 1

        continue

    for to in Ms[n]:

        if not to in v:

            q.append((to, v + [to]))



print(ans)

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

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

for _ in range(M):

    A, B = list(map(int, input().split()))

    G[A - 1].append(B - 1)

    G[B - 1].append(A - 1)



path, ans = [[0]], 0

while len(path) > 0:

    p = path.pop()

    if len(p) == N:

        ans += 1

    else:

        for g in G[p[-1]]:

            if not g in p:

                path.append(p + [g])



print(ans)

# -*- coding: utf-8 -*-
from collections import deque

N, M = list(map(int, input().split()))
Ms = {i: set() for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    Ms[a].add(b)
    Ms[b].add(a)
all = set(range(1, N + 1))
q = deque()
q.append((1, [1]))
ans = 0
while q:
    n, v = q.popleft()
    if set(v) == all:
        ans += 1
        continue
    for to in Ms[n]:
        if not to in v:
            q.append((to, v + [to]))
print(ans)

N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]
for _ in range(M):
    A, B = list(map(int, input().split()))
    G[A - 1].append(B - 1)
    G[B - 1].append(A - 1)
path, ans = [[0]], 0
while len(path) > 0:
    p = path.pop()
    if len(p) == N:
        ans += 1
    else:
        for g in G[p[-1]]:
            if not g in p:
                path.append(p + [g])
print(ans)

-# -*- coding: utf-8 -*- -from collections import deque - -Ms = {i: set() for i in range(1, N + 1)} +G = [[] for _ in range(N)] -    a, b = list(map(int, input().split())) -    Ms[a].add(b) -    Ms[b].add(a) -all = set(range(1, N + 1)) -q = deque() -q.append((1, [1])) -ans = 0 -while q: -    n, v = q.popleft() -    if set(v) == all: +    A, B = list(map(int, input().split())) +    G[A - 1].append(B - 1) +    G[B - 1].append(A - 1) +path, ans = [[0]], 0 +while len(path) > 0: +    p = path.pop() +    if len(p) == N: -        continue -    for to in Ms[n]: -        if not to in v: -            q.append((to, v + [to])) +    else: +        for g in G[p[-1]]: +            if not g in p: +                path.append(p + [g])