import itertools

 

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

graph = [[0] * N for i in range(N)]

for i in range(M):

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

    graph[a-1][b-1] = 1

    graph[b-1][a-1] = 1

 

p = list(itertools.permutations(list(range(N))))

 

Sum = 0

 

for i in range(len(p)):

    if p[i][0] != 0:

        break

    for j in range(N - 1):

        if graph[p[i][j]][p[i][j + 1]] != 1:

            break

        elif j == N - 2:

            Sum += 1

 

print(Sum)
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)



visited = [False for _ in range(N)]



def dfs(v, visited):

  if all(visited):

    return 1

  total = 0

  for cv in g[v]:

    if not visited[cv]:

      visited[cv] = True

      total += dfs(cv, visited)

      visited[cv] = False

  return total

    

visited[0] = True

ret = dfs(0, visited)

print(ret)
import itertools

N, M = list(map(int, input().split()))
graph = [[0] * N for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1][b - 1] = 1
    graph[b - 1][a - 1] = 1
p = list(itertools.permutations(list(range(N))))
Sum = 0
for i in range(len(p)):
    if p[i][0] != 0:
        break
    for j in range(N - 1):
        if graph[p[i][j]][p[i][j + 1]] != 1:
            break
        elif j == N - 2:
            Sum += 1
print(Sum)

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)
visited = [False for _ in range(N)]


def dfs(v, visited):
    if all(visited):
        return 1
    total = 0
    for cv in g[v]:
        if not visited[cv]:
            visited[cv] = True
            total += dfs(cv, visited)
            visited[cv] = False
    return total


visited[0] = True
ret = dfs(0, visited)
print(ret)

-import itertools - -graph = [[0] * N for i in range(N)] +g = [[] for _ in range(N)] -    graph[a - 1][b - 1] = 1 -    graph[b - 1][a - 1] = 1 -p = list(itertools.permutations(list(range(N)))) -Sum = 0 -for i in range(len(p)): -    if p[i][0] != 0: -        break -    for j in range(N - 1): -        if graph[p[i][j]][p[i][j + 1]] != 1: -            break -        elif j == N - 2: -            Sum += 1 -print(Sum) +    g[a - 1].append(b - 1) +    g[b - 1].append(a - 1) +visited = [False for _ in range(N)] + + +def dfs(v, visited): +    if all(visited): +        return 1 +    total = 0 +    for cv in g[v]: +        if not visited[cv]: +            visited[cv] = True +            total += dfs(cv, visited) +            visited[cv] = False +    return total + + +visited[0] = True +ret = dfs(0, visited) +print(ret)