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

import numpy as np



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

graph = [[0 for i in range(n)] for j in range(n)]

graph = np.array(graph)



for i in range(m):

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

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

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



used = [False]*n

used[0] = True



def DFS(v,used):

    if all(used):

        return 1

    ans = 0

    for i in range(n):

        if used[i]:

            continue

        if graph[i,v] == 0:

            continue

        used[i] = True

        ans += DFS(i,used)

        used[i] = False

    return ans

  

print((DFS(0,used)))
from collections import deque



def dfs(G, visited, s, n, ans):

  # すべての頂点を訪れた場合の処理

  if all(visited) :

    ans += 1

    return ans

  #　次の頂点の探索

  for i in range(n) :

    if visited[i] == False and (G[s][i] == 1 or G[i][s] == 1) :

      visited[i] = True

      ans = dfs(G, visited, i, n, ans)

      visited[i] = False

  return ans



#　グラフGの入力

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

G = [[0 for i in range(n)] for j 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

  



visited = [False for i in range(n)]

visited[0] = True

ans = 0

print((dfs(G, visited, 0, n, ans)))
# -*- coding: utf-8 -*-
import numpy as np

n, m = list(map(int, input().split()))
graph = [[0 for i in range(n)] for j in range(n)]
graph = np.array(graph)
for i in range(m):
    a, b = list(map(int, input().split()))
    graph[a - 1, b - 1] = 1
    graph[b - 1, a - 1] = 1
used = [False] * n
used[0] = True


def DFS(v, used):
    if all(used):
        return 1
    ans = 0
    for i in range(n):
        if used[i]:
            continue
        if graph[i, v] == 0:
            continue
        used[i] = True
        ans += DFS(i, used)
        used[i] = False
    return ans


print((DFS(0, used)))

from collections import deque


def dfs(G, visited, s, n, ans):
    # すべての頂点を訪れた場合の処理
    if all(visited):
        ans += 1
        return ans
    # 　次の頂点の探索
    for i in range(n):
        if visited[i] == False and (G[s][i] == 1 or G[i][s] == 1):
            visited[i] = True
            ans = dfs(G, visited, i, n, ans)
            visited[i] = False
    return ans


# 　グラフGの入力
n, m = list(map(int, input().split()))
G = [[0 for i in range(n)] for j 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
visited = [False for i in range(n)]
visited[0] = True
ans = 0
print((dfs(G, visited, 0, n, ans)))

-# -*- coding: utf-8 -*- -import numpy as np - -n, m = list(map(int, input().split())) -graph = [[0 for i in range(n)] for j in range(n)] -graph = np.array(graph) -for i in range(m): -    a, b = list(map(int, input().split())) -    graph[a - 1, b - 1] = 1 -    graph[b - 1, a - 1] = 1 -used = [False] * n -used[0] = True +from collections import deque -def DFS(v, used): -    if all(used): -        return 1 -    ans = 0 +def dfs(G, visited, s, n, ans): +    # すべての頂点を訪れた場合の処理 +    if all(visited): +        ans += 1 +        return ans +    # 　次の頂点の探索 -        if used[i]: -            continue -        if graph[i, v] == 0: -            continue -        used[i] = True -        ans += DFS(i, used) -        used[i] = False +        if visited[i] == False and (G[s][i] == 1 or G[i][s] == 1): +            visited[i] = True +            ans = dfs(G, visited, i, n, ans) +            visited[i] = False -print((DFS(0, used))) +# 　グラフGの入力 +n, m = list(map(int, input().split())) +G = [[0 for i in range(n)] for j 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 +visited = [False for i in range(n)] +visited[0] = True +ans = 0 +print((dfs(G, visited, 0, n, ans)))