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



line = input().split(" ")

n = int(line[0])

m = int(line[1])

edge = [[] for _ in range(n+1)]



for _ in range(m):

    line = input().split(" ")

    a = int(line[0])

    b = int(line[1])



    edge[a].append(b)

    edge[b].append(a)





visited = [False for _ in range(n+1)]

visited[0] = True#dummy

visited[1] = True



def solve(x):

    allVisited = True

    for e in visited:

        allVisited = allVisited and e

    if allVisited:

        return 1



    ret = 0

    for e in edge[x]:

        if not visited[e]:

            visited[e] = True

            ret += solve(e)

            visited[e] = False

    return ret





print((solve(1)))

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

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

edge = [[] for _ in range(n+1)]

for _ in range(m):

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

    a -= 1

    b -= 1

    edge[a].append(b)

    edge[b].append(a)



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

def dfs(v):

    if all(visited):

        return 1

    res = 0

    for e in edge[v]:

        if not visited[e]:

            visited[e] = True

            res += dfs(e)

            visited[e] = False

    return res



visited[0] = True

print((dfs(0)))

# -*- coding: utf-8 -*-
line = input().split(" ")
n = int(line[0])
m = int(line[1])
edge = [[] for _ in range(n + 1)]
for _ in range(m):
    line = input().split(" ")
    a = int(line[0])
    b = int(line[1])
    edge[a].append(b)
    edge[b].append(a)
visited = [False for _ in range(n + 1)]
visited[0] = True  # dummy
visited[1] = True


def solve(x):
    allVisited = True
    for e in visited:
        allVisited = allVisited and e
    if allVisited:
        return 1
    ret = 0
    for e in edge[x]:
        if not visited[e]:
            visited[e] = True
            ret += solve(e)
            visited[e] = False
    return ret


print((solve(1)))

# -*- coding: utf-8 -*-
n, m = list(map(int, input().split()))
edge = [[] for _ in range(n + 1)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)
visited = [False for _ in range(n)]


def dfs(v):
    if all(visited):
        return 1
    res = 0
    for e in edge[v]:
        if not visited[e]:
            visited[e] = True
            res += dfs(e)
            visited[e] = False
    return res


visited[0] = True
print((dfs(0)))

-line = input().split(" ") -n = int(line[0]) -m = int(line[1]) +n, m = list(map(int, input().split())) -    line = input().split(" ") -    a = int(line[0]) -    b = int(line[1]) +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 -visited = [False for _ in range(n + 1)] -visited[0] = True  # dummy -visited[1] = True +visited = [False for _ in range(n)] -def solve(x): -    allVisited = True -    for e in visited: -        allVisited = allVisited and e -    if allVisited: +def dfs(v): +    if all(visited): -    ret = 0 -    for e in edge[x]: +    res = 0 +    for e in edge[v]: -            ret += solve(e) +            res += dfs(e) -    return ret +    return res -print((solve(1))) +visited[0] = True +print((dfs(0)))