from itertools import permutations



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

D = [[0]*n for i in range(n)]

for i in range(m):

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

	D[a-1][b-1] = 1

	D[b-1][a-1] = 1

cnt = 0

for a in permutations(list(range(n))):

	if a[0] != 0:

		break

	tmp = 1

	for i in range(n-1):

		tmp = tmp * D[a[i]][a[i+1]]

	cnt += tmp

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

D = [list() for i in range(n)]

for i in range(m):

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

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

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



d = [0]*n

d[0] = 1

cnt = 0



def dfs(x):

  global cnt

  if all(d):

    cnt += 1

    return

  for i in D[x]:

    if d[i] == 0:

      d[i] = 1

      dfs(i)

      d[i] = 0



dfs(0)

print(cnt)
from itertools import permutations

n, m = list(map(int, input().split()))
D = [[0] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    D[a - 1][b - 1] = 1
    D[b - 1][a - 1] = 1
cnt = 0
for a in permutations(list(range(n))):
    if a[0] != 0:
        break
    tmp = 1
    for i in range(n - 1):
        tmp = tmp * D[a[i]][a[i + 1]]
    cnt += tmp
print(cnt)

n, m = list(map(int, input().split()))
D = [list() for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    D[a - 1].append(b - 1)
    D[b - 1].append(a - 1)
d = [0] * n
d[0] = 1
cnt = 0


def dfs(x):
    global cnt
    if all(d):
        cnt += 1
        return
    for i in D[x]:
        if d[i] == 0:
            d[i] = 1
            dfs(i)
            d[i] = 0


dfs(0)
print(cnt)

-from itertools import permutations - -D = [[0] * n for i in range(n)] +D = [list() for i in range(n)] -    D[a - 1][b - 1] = 1 -    D[b - 1][a - 1] = 1 +    D[a - 1].append(b - 1) +    D[b - 1].append(a - 1) +d = [0] * n +d[0] = 1 -for a in permutations(list(range(n))): -    if a[0] != 0: -        break -    tmp = 1 -    for i in range(n - 1): -        tmp = tmp * D[a[i]][a[i + 1]] -    cnt += tmp + + +def dfs(x): +    global cnt +    if all(d): +        cnt += 1 +        return +    for i in D[x]: +        if d[i] == 0: +            d[i] = 1 +            dfs(i) +            d[i] = 0 + + +dfs(0)