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

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



for i in range(M):

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

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

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



def dfs(i, visited):

    if all(visited):

        return 1

    total = 0

    for j in graph[i]:

        if not visited[j]:

            nvisited = visited[:]

            nvisited[j] = True

            total += dfs(j, nvisited)

    return total



def main():

    """ main """

    visited = [False] * N

    visited[0] = True

    print((dfs(0, visited)))



if __name__ == '__main__':

    main()

# C. One-stroke Path

# https://atcoder.jp/contests/abc054/tasks/abc054_c



from collections import deque



def dfs(i, visited):

    stack = deque()

    total = 0

    stack.append((i, visited))

    while stack:

        idx, vis = stack.pop()

        if all(vis):

            total += 1

        for j in graph[idx]:

            if not vis[j]:

                v = vis[:]

                v[j] = True

                stack.append((j, v))

    return total



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

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



for i in range(M):

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

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

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



visited = [False] * N

visited[0] = True

print((dfs(0, visited)))



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


def dfs(i, visited):
    if all(visited):
        return 1
    total = 0
    for j in graph[i]:
        if not visited[j]:
            nvisited = visited[:]
            nvisited[j] = True
            total += dfs(j, nvisited)
    return total


def main():
    """main"""
    visited = [False] * N
    visited[0] = True
    print((dfs(0, visited)))


if __name__ == "__main__":
    main()

# C. One-stroke Path
# https://atcoder.jp/contests/abc054/tasks/abc054_c
from collections import deque


def dfs(i, visited):
    stack = deque()
    total = 0
    stack.append((i, visited))
    while stack:
        idx, vis = stack.pop()
        if all(vis):
            total += 1
        for j in graph[idx]:
            if not vis[j]:
                v = vis[:]
                v[j] = True
                stack.append((j, v))
    return total


N, M = list(map(int, input().split()))
graph = [[] for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
visited = [False] * N
visited[0] = True
print((dfs(0, visited)))

+# C. One-stroke Path +# https://atcoder.jp/contests/abc054/tasks/abc054_c +from collections import deque + + +def dfs(i, visited): +    stack = deque() +    total = 0 +    stack.append((i, visited)) +    while stack: +        idx, vis = stack.pop() +        if all(vis): +            total += 1 +        for j in graph[idx]: +            if not vis[j]: +                v = vis[:] +                v[j] = True +                stack.append((j, v)) +    return total + + - - -def dfs(i, visited): -    if all(visited): -        return 1 -    total = 0 -    for j in graph[i]: -        if not visited[j]: -            nvisited = visited[:] -            nvisited[j] = True -            total += dfs(j, nvisited) -    return total - - -def main(): -    """main""" -    visited = [False] * N -    visited[0] = True -    print((dfs(0, visited))) - - -if __name__ == "__main__": -    main() +visited = [False] * N +visited[0] = True +print((dfs(0, visited)))