import itertools



n,m = list(map(int,input().split()))#頂点の数、辺の数



graph = [[False for i in range(n)] for j in range(n)]



for i in range(m):

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

    a -= 1

    b -= 1

    graph[a][b] = True

    graph[b][a] = True



ans = 0

for i in itertools.permutations(list(range(n))):

    if i[0] != 0:

        continue

    visited = [0]*n

    visited[0] += 1

    for j in range(n):

        if j == n-1:

            if 0 not in visited:

                ans += 1

            break

        if graph[i[j]][i[j+1]] == True:

            visited[i[j+1]] += 1

        

            

print(ans)

import itertools



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

path = [[] for i in range(n+1)]

for i in range(m):

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

    path[a].append(b)

    path[b].append(a)



ans = 0

l = [i for i in range(2,n+1)]

for v in itertools.permutations(l,n-1):

    flag = True

    if v[0] not in path[1]:

        flag = False

        continue

    for k in range(1,n-1):

        if v[k] not in path[v[k-1]]:

            flag = False

            continue

    if flag:

        ans += 1



print(ans)

import itertools

n, m = list(map(int, input().split()))  # 頂点の数、辺の数
graph = [[False for i in range(n)] for j in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    graph[a][b] = True
    graph[b][a] = True
ans = 0
for i in itertools.permutations(list(range(n))):
    if i[0] != 0:
        continue
    visited = [0] * n
    visited[0] += 1
    for j in range(n):
        if j == n - 1:
            if 0 not in visited:
                ans += 1
            break
        if graph[i[j]][i[j + 1]] == True:
            visited[i[j + 1]] += 1
print(ans)

import itertools

n, m = list(map(int, input().split()))
path = [[] for i in range(n + 1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    path[a].append(b)
    path[b].append(a)
ans = 0
l = [i for i in range(2, n + 1)]
for v in itertools.permutations(l, n - 1):
    flag = True
    if v[0] not in path[1]:
        flag = False
        continue
    for k in range(1, n - 1):
        if v[k] not in path[v[k - 1]]:
            flag = False
            continue
    if flag:
        ans += 1
print(ans)

-n, m = list(map(int, input().split()))  # 頂点の数、辺の数 -graph = [[False for i in range(n)] for j in range(n)] +n, m = list(map(int, input().split())) +path = [[] for i in range(n + 1)] -    a -= 1 -    b -= 1 -    graph[a][b] = True -    graph[b][a] = True +    path[a].append(b) +    path[b].append(a) -for i in itertools.permutations(list(range(n))): -    if i[0] != 0: +l = [i for i in range(2, n + 1)] +for v in itertools.permutations(l, n - 1): +    flag = True +    if v[0] not in path[1]: +        flag = False -    visited = [0] * n -    visited[0] += 1 -    for j in range(n): -        if j == n - 1: -            if 0 not in visited: -                ans += 1 -            break -        if graph[i[j]][i[j + 1]] == True: -            visited[i[j + 1]] += 1 +    for k in range(1, n - 1): +        if v[k] not in path[v[k - 1]]: +            flag = False +            continue +    if flag: +        ans += 1