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

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

for _ in range(m):

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

    a -= 1

    b -= 1

    edge[a].append(b)

    edge[b].append(a)





def dfs(v, seen, res):

    seen[v] = True

    if all(seen):

        res += 1



    for i in edge[v]:

        if not seen[i]:

            tmp = [tf for tf in seen]

            res = dfs(i, tmp, res)



    return res





visited = [False]*n

ans = dfs(0, visited, 0)

print(ans)

import itertools

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

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

for _ in range(M):

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

    edge[a].append(b)

    edge[b].append(a)





def isOK(seq):

    s = 1

    for t in seq:

        if t in edge[s]:

            s = t

        else:

            return False

    return True





ans = 0

for seq in itertools.permutations(list(range(2, N + 1))):

    if isOK(seq):

        ans += 1



print(ans)

n, m = list(map(int, input().split()))
edge = [[] for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)


def dfs(v, seen, res):
    seen[v] = True
    if all(seen):
        res += 1
    for i in edge[v]:
        if not seen[i]:
            tmp = [tf for tf in seen]
            res = dfs(i, tmp, res)
    return res


visited = [False] * n
ans = dfs(0, visited, 0)
print(ans)

import itertools

N, M = list(map(int, input().split()))
edge = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    edge[a].append(b)
    edge[b].append(a)


def isOK(seq):
    s = 1
    for t in seq:
        if t in edge[s]:
            s = t
        else:
            return False
    return True


ans = 0
for seq in itertools.permutations(list(range(2, N + 1))):
    if isOK(seq):
        ans += 1
print(ans)

-n, m = list(map(int, input().split())) -edge = [[] for _ in range(n)] -for _ in range(m): +import itertools + +N, M = list(map(int, input().split())) +edge = [[] for _ in range(N + 1)] +for _ in range(M): -    a -= 1 -    b -= 1 -def dfs(v, seen, res): -    seen[v] = True -    if all(seen): -        res += 1 -    for i in edge[v]: -        if not seen[i]: -            tmp = [tf for tf in seen] -            res = dfs(i, tmp, res) -    return res +def isOK(seq): +    s = 1 +    for t in seq: +        if t in edge[s]: +            s = t +        else: +            return False +    return True -visited = [False] * n -ans = dfs(0, visited, 0) +ans = 0 +for seq in itertools.permutations(list(range(2, N + 1))): +    if isOK(seq): +        ans += 1