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

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

for i in range(M):

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

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

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

def dfs(start,route):

    route.append(start)

    if len(route) == N:

        route.remove(start)

        return 1

    res = 0

    for i in edge[start]:

        if i not in route:

            res += dfs(i,route)

    route.remove(start)

    return res

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)
N, M = list(map(int, input().split()))
edge = [[] for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    edge[a - 1].append(b - 1)
    edge[b - 1].append(a - 1)


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


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)

+import copy +import sys + +sys.setrecursionlimit(10**7) -edge = [[] for _ in range(N)] -for i in range(M): +edges = [[] for _ in range(N)] +for _ in range(M): -    edge[a - 1].append(b - 1) -    edge[b - 1].append(a - 1) +    edges[a - 1].append(b - 1) +    edges[b - 1].append(a - 1) +ans = 0 -def dfs(start, route): -    route.append(start) -    if len(route) == N: -        route.remove(start) -        return 1 -    res = 0 -    for i in edge[start]: -        if i not in route: -            res += dfs(i, route) -    route.remove(start) -    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) -print((dfs(0, []))) +dfs(0, []) +print(ans)