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

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

for i in range(M):

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

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

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

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

C = 0



def func(x, c):

    global C

    c += 1

    last = True

    for r in R[x]:

        if r in Parents[x]:

            continue

        for i in range(len(Parents[x])):

            Parents[r].append(Parents[x][i])

        Parents[r].append(x)

        last = False

        func(r, c)

        for i in range(len(Parents[x])):

            Parents[r].remove(Parents[x][i])

        Parents[r].remove(x)

    if last:

        if c == N:

            C += 1



func(0, 0)

print(C)
import sys

sys.setrecursionlimit(10 ** 9)

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

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

for _ in range(M):

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

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

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

D = [0] * N

D[0] = 1



C = 0

def dfs(n):

    global C

    if not 0 in D:

        C += 1

        return

    for i in G[n]:

        if D[i] == 1:

            continue

        D[i] = 1

        dfs(i)

        D[i] = 0



dfs(0)

print(C)
N, M = list(map(int, input().split()))
R = [[] for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    R[a - 1].append(b - 1)
    R[b - 1].append(a - 1)
Parents = [[] for i in range(N)]
C = 0


def func(x, c):
    global C
    c += 1
    last = True
    for r in R[x]:
        if r in Parents[x]:
            continue
        for i in range(len(Parents[x])):
            Parents[r].append(Parents[x][i])
        Parents[r].append(x)
        last = False
        func(r, c)
        for i in range(len(Parents[x])):
            Parents[r].remove(Parents[x][i])
        Parents[r].remove(x)
    if last:
        if c == N:
            C += 1


func(0, 0)
print(C)

import sys

sys.setrecursionlimit(10**9)
N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
D = [0] * N
D[0] = 1
C = 0


def dfs(n):
    global C
    if not 0 in D:
        C += 1
        return
    for i in G[n]:
        if D[i] == 1:
            continue
        D[i] = 1
        dfs(i)
        D[i] = 0


dfs(0)
print(C)

+import sys + +sys.setrecursionlimit(10**9) -R = [[] for i in range(N)] -for i in range(M): +G = [[] for _ in range(N)] +for _ in range(M): -    R[a - 1].append(b - 1) -    R[b - 1].append(a - 1) -Parents = [[] for i in range(N)] +    G[a - 1].append(b - 1) +    G[b - 1].append(a - 1) +D = [0] * N +D[0] = 1 -def func(x, c): +def dfs(n): -    c += 1 -    last = True -    for r in R[x]: -        if r in Parents[x]: +    if not 0 in D: +        C += 1 +        return +    for i in G[n]: +        if D[i] == 1: -        for i in range(len(Parents[x])): -            Parents[r].append(Parents[x][i]) -        Parents[r].append(x) -        last = False -        func(r, c) -        for i in range(len(Parents[x])): -            Parents[r].remove(Parents[x][i]) -        Parents[r].remove(x) -    if last: -        if c == N: -            C += 1 +        D[i] = 1 +        dfs(i) +        D[i] = 0 -func(0, 0) +dfs(0)