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



graph = {i:[] for i in range(1, n+1)}

for _ in range(m):

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

    graph[a].append(b)

    graph[b].append(a)



visited = [False] * (n+1)



stack = [(1, 1, visited)]



count = 0

while stack:

    now, dist, visited_ = stack.pop()

    visited = visited_.copy()

    visited[now] = True

    if dist == n:

        count += 1

    for neighbor in graph[now]:

        if not visited[neighbor]:

            stack.append((neighbor, dist + 1, visited))



print(count)

from itertools import permutations



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

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

for _ in range(M):

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

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

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



ans = 0

for comb in permutations(list(range(1, N)), N-1):

    v = 0

    valid = True

    for i in comb:

        if i not in graph[v]:

            valid = False

            break

        v = i

    if valid:

        ans += 1



print(ans)

n, m = list(map(int, input().split()))
graph = {i: [] for i in range(1, n + 1)}
for _ in range(m):
    a, b = list(map(int, input().split()))
    graph[a].append(b)
    graph[b].append(a)
visited = [False] * (n + 1)
stack = [(1, 1, visited)]
count = 0
while stack:
    now, dist, visited_ = stack.pop()
    visited = visited_.copy()
    visited[now] = True
    if dist == n:
        count += 1
    for neighbor in graph[now]:
        if not visited[neighbor]:
            stack.append((neighbor, dist + 1, visited))
print(count)

from itertools import permutations

N, M = list(map(int, input().split()))
graph = [[] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
ans = 0
for comb in permutations(list(range(1, N)), N - 1):
    v = 0
    valid = True
    for i in comb:
        if i not in graph[v]:
            valid = False
            break
        v = i
    if valid:
        ans += 1
print(ans)

-n, m = list(map(int, input().split())) -graph = {i: [] for i in range(1, n + 1)} -for _ in range(m): +from itertools import permutations + +N, M = list(map(int, input().split())) +graph = [[] for _ in range(N)] +for _ in range(M): -    graph[a].append(b) -    graph[b].append(a) -visited = [False] * (n + 1) -stack = [(1, 1, visited)] -count = 0 -while stack: -    now, dist, visited_ = stack.pop() -    visited = visited_.copy() -    visited[now] = True -    if dist == n: -        count += 1 -    for neighbor in graph[now]: -        if not visited[neighbor]: -            stack.append((neighbor, dist + 1, visited)) -print(count) +    graph[a - 1].append(b - 1) +    graph[b - 1].append(a - 1) +ans = 0 +for comb in permutations(list(range(1, N)), N - 1): +    v = 0 +    valid = True +    for i in comb: +        if i not in graph[v]: +            valid = False +            break +        v = i +    if valid: +        ans += 1 +print(ans)