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

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

for _ in range(M):

    a, b = [int(x)-1 for x in input().split()]

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

visited = [False] * N





def dfs(v):

    visited[v] = True

    if all(visited):

        visited[v] = False

        return 1

    ret = 0

    for u in range(N):

        if v == u or visited[u] or G[v][u] == 0:

            continue

        ret += dfs(u)

    visited[v] = False

    return ret





print((dfs(0)))

from itertools import permutations

import sys

input = sys.stdin.readline



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

connected = [[False] * (N+1) for _ in range(N+1)]

for _ in range(M):

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

    connected[a][b] = connected[b][a] = True

ans = 0

for perm in permutations(list(range(2, N+1))):

    perm = (1,) + perm

    for i in range(N-1):

        u, v = perm[i], perm[i+1]

        if not connected[u][v]:

            break

    else:

        ans += 1

print(ans)
N, M = list(map(int, input().split()))
G = [[0] * N for _ in range(N)]
for _ in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    G[a][b] = G[b][a] = 1
visited = [False] * N


def dfs(v):
    visited[v] = True
    if all(visited):
        visited[v] = False
        return 1
    ret = 0
    for u in range(N):
        if v == u or visited[u] or G[v][u] == 0:
            continue
        ret += dfs(u)
    visited[v] = False
    return ret


print((dfs(0)))

from itertools import permutations
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
connected = [[False] * (N + 1) for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    connected[a][b] = connected[b][a] = True
ans = 0
for perm in permutations(list(range(2, N + 1))):
    perm = (1,) + perm
    for i in range(N - 1):
        u, v = perm[i], perm[i + 1]
        if not connected[u][v]:
            break
    else:
        ans += 1
print(ans)

+from itertools import permutations +import sys + +input = sys.stdin.readline -G = [[0] * N for _ in range(N)] +connected = [[False] * (N + 1) for _ in range(N + 1)] -    a, b = [int(x) - 1 for x in input().split()] -    G[a][b] = G[b][a] = 1 -visited = [False] * N - - -def dfs(v): -    visited[v] = True -    if all(visited): -        visited[v] = False -        return 1 -    ret = 0 -    for u in range(N): -        if v == u or visited[u] or G[v][u] == 0: -            continue -        ret += dfs(u) -    visited[v] = False -    return ret - - -print((dfs(0))) +    a, b = list(map(int, input().split())) +    connected[a][b] = connected[b][a] = True +ans = 0 +for perm in permutations(list(range(2, N + 1))): +    perm = (1,) + perm +    for i in range(N - 1): +        u, v = perm[i], perm[i + 1] +        if not connected[u][v]: +            break +    else: +        ans += 1 +print(ans)