def DFS(num):

    global ans,color

    color[num]="black"

    if "white" not in color:

        ans +=1

    for i in M[num]:

        if color[i]=="white":

            DFS(i)

    color[num]="white"





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

AB=[list(map(int,input().split())) for _ in range(m)]



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

color=["white" for _ in range(n)]

for a,b in AB:

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

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



ans=0

DFS(0)

print(ans)
from itertools import permutations

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

AB=[list(map(int,input().split())) for _ in range(m)]

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

for a,b in AB:

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

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



ans=0

for A in permutations(list(range(n)),n):

    if A[0]==0:

        for i in range(n):

            if i==n-1:

                ans +=1

                break

            if A[i+1] not in MAP[A[i]]:break

print(ans)
def DFS(num):
    global ans, color
    color[num] = "black"
    if "white" not in color:
        ans += 1
    for i in M[num]:
        if color[i] == "white":
            DFS(i)
    color[num] = "white"


n, m = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(m)]
M = [[] for _ in range(n)]
color = ["white" for _ in range(n)]
for a, b in AB:
    M[a - 1].append(b - 1)
    M[b - 1].append(a - 1)
ans = 0
DFS(0)
print(ans)

from itertools import permutations

n, m = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(m)]
MAP = [[] for _ in range(n)]
for a, b in AB:
    MAP[a - 1].append(b - 1)
    MAP[b - 1].append(a - 1)
ans = 0
for A in permutations(list(range(n)), n):
    if A[0] == 0:
        for i in range(n):
            if i == n - 1:
                ans += 1
                break
            if A[i + 1] not in MAP[A[i]]:
                break
print(ans)

-def DFS(num): -    global ans, color -    color[num] = "black" -    if "white" not in color: -        ans += 1 -    for i in M[num]: -        if color[i] == "white": -            DFS(i) -    color[num] = "white" - +from itertools import permutations -M = [[] for _ in range(n)] -color = ["white" for _ in range(n)] +MAP = [[] for _ in range(n)] -    M[a - 1].append(b - 1) -    M[b - 1].append(a - 1) +    MAP[a - 1].append(b - 1) +    MAP[b - 1].append(a - 1) -DFS(0) +for A in permutations(list(range(n)), n): +    if A[0] == 0: +        for i in range(n): +            if i == n - 1: +                ans += 1 +                break +            if A[i + 1] not in MAP[A[i]]: +                break