import copy

import sys

sys.setrecursionlimit(10**7)

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

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

for _ in range(M):

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

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

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

ans = 0

def dfs(start,path):

    next_path = copy.copy(path)

    global ans

    next_path.append(start)

    if len(next_path) == N:

        ans += 1

        return

    for i in edges[start]:

        if i not in next_path:

            dfs(i,next_path)

dfs(0,[])

print(ans)
def dfs(start,path):

    res = 0

    path.append(start)

    if len(path) == N:

        res += 1

        return res

    for i in graph[start]:

        if i not in path:

            res += dfs(i,path)

            path.pop()

    return res



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

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

for i in range(M):

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

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

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

print((dfs(0,[])))
import copy
import sys

sys.setrecursionlimit(10**7)
N, M = list(map(int, input().split()))
edges = [[] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)
ans = 0


def dfs(start, path):
    next_path = copy.copy(path)
    global ans
    next_path.append(start)
    if len(next_path) == N:
        ans += 1
        return
    for i in edges[start]:
        if i not in next_path:
            dfs(i, next_path)


dfs(0, [])
print(ans)

def dfs(start, path):
    res = 0
    path.append(start)
    if len(path) == N:
        res += 1
        return res
    for i in graph[start]:
        if i not in path:
            res += dfs(i, path)
            path.pop()
    return res


N, M = list(map(int, input().split()))
graph = [[] for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
print((dfs(0, [])))

-import copy -import sys - -sys.setrecursionlimit(10**7) -N, M = list(map(int, input().split())) -edges = [[] for _ in range(N)] -for _ in range(M): -    a, b = list(map(int, input().split())) -    edges[a - 1].append(b - 1) -    edges[b - 1].append(a - 1) -ans = 0 +def dfs(start, path): +    res = 0 +    path.append(start) +    if len(path) == N: +        res += 1 +        return res +    for i in graph[start]: +        if i not in path: +            res += dfs(i, path) +            path.pop() +    return res -def dfs(start, path): -    next_path = copy.copy(path) -    global ans -    next_path.append(start) -    if len(next_path) == N: -        ans += 1 -        return -    for i in edges[start]: -        if i not in next_path: -            dfs(i, next_path) - - -dfs(0, []) -print(ans) +N, M = list(map(int, input().split())) +graph = [[] for _ in range(N)] +for i in range(M): +    a, b = list(map(int, input().split())) +    graph[a - 1].append(b - 1) +    graph[b - 1].append(a - 1) +print((dfs(0, [])))