import numpy as np



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

arr = [[] for i in range(N)]



for i in range(M):

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

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

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



for i in range(len(arr)):

    arr[i].sort





def dfs(array,point,cnt):

    

    if(array[point]==[]):

        return cnt



    tmparr = array.copy()

    ps = tmparr[point]

    tmparr[point] = []

    

    if sum(map(len,tmparr)) == 0:

        return cnt+1

    

    for p in ps:

        #print(tmparr, p)

        cnt = dfs(tmparr,p,cnt)

    

    return cnt



print((dfs(arr,0,0)))
N, M = list(map(int, input().split(" ")))

path = [tuple(map(int,input().split(" "))) for _ in range(M)]

path += [(item[1], item[0]) for item in path]

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

visited[0] = True



def dfs(v_, visited):

    if not (False in visited):

        return 1

    ret = 0

    v = v_ + 1 

    for i_ in range(N):

        i = i_ + 1

        if not ((i, v) in path):

            continue

        if visited[i_]:

            continue

        visited[i_] = True

        ret += dfs(i_, visited)

        visited[i_] = False

        

    return ret

print((dfs(0, visited)))
import numpy as np

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


def dfs(array, point, cnt):
    if array[point] == []:
        return cnt
    tmparr = array.copy()
    ps = tmparr[point]
    tmparr[point] = []
    if sum(map(len, tmparr)) == 0:
        return cnt + 1
    for p in ps:
        # print(tmparr, p)
        cnt = dfs(tmparr, p, cnt)
    return cnt


print((dfs(arr, 0, 0)))

N, M = list(map(int, input().split(" ")))
path = [tuple(map(int, input().split(" "))) for _ in range(M)]
path += [(item[1], item[0]) for item in path]
visited = [False for _ in range(N)]
visited[0] = True


def dfs(v_, visited):
    if not (False in visited):
        return 1
    ret = 0
    v = v_ + 1
    for i_ in range(N):
        i = i_ + 1
        if not ((i, v) in path):
            continue
        if visited[i_]:
            continue
        visited[i_] = True
        ret += dfs(i_, visited)
        visited[i_] = False
    return ret


print((dfs(0, visited)))

-import numpy as np - -N, M = list(map(int, input().split())) -arr = [[] for i in range(N)] -for i in range(M): -    a, b = list(map(int, input().split())) -    arr[a - 1].append(b - 1) -    arr[b - 1].append(a - 1) -for i in range(len(arr)): -    arr[i].sort +N, M = list(map(int, input().split(" "))) +path = [tuple(map(int, input().split(" "))) for _ in range(M)] +path += [(item[1], item[0]) for item in path] +visited = [False for _ in range(N)] +visited[0] = True -def dfs(array, point, cnt): -    if array[point] == []: -        return cnt -    tmparr = array.copy() -    ps = tmparr[point] -    tmparr[point] = [] -    if sum(map(len, tmparr)) == 0: -        return cnt + 1 -    for p in ps: -        # print(tmparr, p) -        cnt = dfs(tmparr, p, cnt) -    return cnt +def dfs(v_, visited): +    if not (False in visited): +        return 1 +    ret = 0 +    v = v_ + 1 +    for i_ in range(N): +        i = i_ + 1 +        if not ((i, v) in path): +            continue +        if visited[i_]: +            continue +        visited[i_] = True +        ret += dfs(i_, visited) +        visited[i_] = False +    return ret -print((dfs(arr, 0, 0))) +print((dfs(0, visited)))