#DFS

from collections import deque



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

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

for i in range(M):

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

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

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

  

stack = deque([(0, 0)])

visited = [0] * N

depth = 0

ans = 0

while stack:

  now, depth = stack.pop()

  if depth == N-1:

    ans += 1

    continue

  visited[depth] = now

  for nxt in G[now]:

    if nxt not in visited[:depth+1]:

      stack.append((nxt, depth+1))

    

print(ans)
#順列全探索



from itertools import permutations



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

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

for i in range(M):

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

  G[a-1][b-1] = 1

  G[b-1][a-1] = 1



perms = permutations(list(range(1, N)))

ans = 0



for perm in perms:

  now = 0

  for v in perm:

    if G[now][v] == 0:

      break

    now = v

  else:

    ans += 1

    

print(ans)
# DFS
from collections import deque

N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
stack = deque([(0, 0)])
visited = [0] * N
depth = 0
ans = 0
while stack:
    now, depth = stack.pop()
    if depth == N - 1:
        ans += 1
        continue
    visited[depth] = now
    for nxt in G[now]:
        if nxt not in visited[: depth + 1]:
            stack.append((nxt, depth + 1))
print(ans)

# 順列全探索
from itertools import permutations

N, M = list(map(int, input().split()))
G = [[0] * N for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    G[a - 1][b - 1] = 1
    G[b - 1][a - 1] = 1
perms = permutations(list(range(1, N)))
ans = 0
for perm in perms:
    now = 0
    for v in perm:
        if G[now][v] == 0:
            break
        now = v
    else:
        ans += 1
print(ans)

-# DFS -from collections import deque +# 順列全探索 +from itertools import permutations -G = [[] for _ in range(N)] +G = [[0] * N for _ in range(N)] -    G[a - 1].append(b - 1) -    G[b - 1].append(a - 1) -stack = deque([(0, 0)]) -visited = [0] * N -depth = 0 +    G[a - 1][b - 1] = 1 +    G[b - 1][a - 1] = 1 +perms = permutations(list(range(1, N))) -while stack: -    now, depth = stack.pop() -    if depth == N - 1: +for perm in perms: +    now = 0 +    for v in perm: +        if G[now][v] == 0: +            break +        now = v +    else: -        continue -    visited[depth] = now -    for nxt in G[now]: -        if nxt not in visited[: depth + 1]: -            stack.append((nxt, depth + 1))