import sys

input = sys.stdin.readline

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

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

for i in range(M):

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

    a -= 1

    b -= 1

    edge_from[a].append(b)

    edge_from[b].append(a)



def rec(v, visited):

    if len(visited) == N:

        return 1

    ret = 0

    for nxt in edge_from[v]:

        if nxt not in visited:

            ret += rec(nxt, [x for x in visited]+[nxt])

    return ret

print((rec(0, [0])))
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)



def dfs(i, used):

    if len(used) == N:

        return 1

    ans = 0

    for j in edges[i]:

        if j not in used:

            ans += dfs(j, used+[j])

    return ans

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

input = sys.stdin.readline
N, M = list(map(int, input().split()))
edge_from = [[] for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edge_from[a].append(b)
    edge_from[b].append(a)


def rec(v, visited):
    if len(visited) == N:
        return 1
    ret = 0
    for nxt in edge_from[v]:
        if nxt not in visited:
            ret += rec(nxt, [x for x in visited] + [nxt])
    return ret


print((rec(0, [0])))

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)


def dfs(i, used):
    if len(used) == N:
        return 1
    ans = 0
    for j in edges[i]:
        if j not in used:
            ans += dfs(j, used + [j])
    return ans


print((dfs(0, [0])))

-import sys - -input = sys.stdin.readline -edge_from = [[] for _ in range(N)] -for i in range(M): +edges = [[] for _ in range(N)] +for _ in range(M): -    a -= 1 -    b -= 1 -    edge_from[a].append(b) -    edge_from[b].append(a) +    edges[a - 1].append(b - 1) +    edges[b - 1].append(a - 1) -def rec(v, visited): -    if len(visited) == N: +def dfs(i, used): +    if len(used) == N: -    ret = 0 -    for nxt in edge_from[v]: -        if nxt not in visited: -            ret += rec(nxt, [x for x in visited] + [nxt]) -    return ret +    ans = 0 +    for j in edges[i]: +        if j not in used: +            ans += dfs(j, used + [j]) +    return ans -print((rec(0, [0]))) +print((dfs(0, [0])))