import copy

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





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

for i in range(m):

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

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

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

  

ans = 0



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





def solve(i, c):

  c[i] = True



  global ans

  if c.count(False) == 0:

    ans += 1

    return

  else:

    for j in paths[i]:

      if c[j] == False: 

        solve(j, copy.deepcopy(c))

        

      



        

solve(0, copy.deepcopy(checked))

print(ans)

    

#print(paths[0])
N, M = list(map(int, input().split()))



if M == 0:

    print((0))

    exit()



es = [[] for i in range(M+1)]

for i in range(M):

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

    a,b = a-1, b-1

    es[a].append(b)

    es[b].append(a)



def dfs(v, visited, es, cnt):



    #print("--------------")

    #print((v, visited, cnt))



    if cnt == N-1:

        return 1

    ret = 0

    for i in es[v]:

        if visited[i] == True:

            continue



        visited[i] = True

        ret += dfs(i, visited, es, cnt+1)

        visited[i] = False



    return ret



visited = [False] * N

visited[0] = True



ans = dfs(0,visited,es,0)

print(ans)
import copy

n, m = list(map(int, input().split()))
paths = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    paths[a - 1].append(b - 1)
    paths[b - 1].append(a - 1)
ans = 0
checked = [False for _ in range(n)]


def solve(i, c):
    c[i] = True
    global ans
    if c.count(False) == 0:
        ans += 1
        return
    else:
        for j in paths[i]:
            if c[j] == False:
                solve(j, copy.deepcopy(c))


solve(0, copy.deepcopy(checked))
print(ans)
# print(paths[0])

N, M = list(map(int, input().split()))
if M == 0:
    print((0))
    exit()
es = [[] for i in range(M + 1)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    es[a].append(b)
    es[b].append(a)


def dfs(v, visited, es, cnt):
    # print("--------------")
    # print((v, visited, cnt))
    if cnt == N - 1:
        return 1
    ret = 0
    for i in es[v]:
        if visited[i] == True:
            continue
        visited[i] = True
        ret += dfs(i, visited, es, cnt + 1)
        visited[i] = False
    return ret


visited = [False] * N
visited[0] = True
ans = dfs(0, visited, es, 0)
print(ans)

-import copy - -n, m = list(map(int, input().split())) -paths = [[] for _ in range(n)] -for i in range(m): +N, M = list(map(int, input().split())) +if M == 0: +    print((0)) +    exit() +es = [[] for i in range(M + 1)] +for i in range(M): -    paths[a - 1].append(b - 1) -    paths[b - 1].append(a - 1) -ans = 0 -checked = [False for _ in range(n)] +    a, b = a - 1, b - 1 +    es[a].append(b) +    es[b].append(a) -def solve(i, c): -    c[i] = True -    global ans -    if c.count(False) == 0: -        ans += 1 -        return -    else: -        for j in paths[i]: -            if c[j] == False: -                solve(j, copy.deepcopy(c)) +def dfs(v, visited, es, cnt): +    # print((v, visited, cnt)) +    if cnt == N - 1: +        return 1 +    ret = 0 +    for i in es[v]: +        if visited[i] == True: +            continue +        visited[i] = True +        ret += dfs(i, visited, es, cnt + 1) +        visited[i] = False +    return ret -solve(0, copy.deepcopy(checked)) +visited = [False] * N +visited[0] = True +ans = dfs(0, visited, es, 0) -# print(paths[0])