from itertools import permutations

from math import factorial



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

edge = []



for i in range(m):

    ai, bi = list(map(int, input().split(' ')))

    edge.append([ai,bi])





x = [i for i in range(1,n+1)]

ls = list(permutations(x))

ans = 0

for l in range(factorial(n-1)):

    cnt = 0

    for i in range(n-1):

        for j in range(m):

            if (ls[l][i] in edge[j]) and (ls[l][i+1] in edge[j]):

                cnt += 1

    if cnt == n-1:

        ans += 1





print(ans)

from itertools import permutations

from math import factorial



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

edge = []

for i in range(m):

    ai, bi = list(map(int, input().split(' ')))

    edge.append([ai, bi])



l = [i for i in range(1, n+1)]

ls = list(permutations(l))

ans = 0

for i in range(factorial(n-1)):

    y = 0

    for j in range(n-1):

        for k in edge:

            if (ls[i][j+1] in k) and (ls[i][j] in k):

                y += 1

    if y == n-1:

        ans += 1



print(ans)
from itertools import permutations
from math import factorial

n, m = list(map(int, input().split(" ")))
edge = []
for i in range(m):
    ai, bi = list(map(int, input().split(" ")))
    edge.append([ai, bi])
x = [i for i in range(1, n + 1)]
ls = list(permutations(x))
ans = 0
for l in range(factorial(n - 1)):
    cnt = 0
    for i in range(n - 1):
        for j in range(m):
            if (ls[l][i] in edge[j]) and (ls[l][i + 1] in edge[j]):
                cnt += 1
    if cnt == n - 1:
        ans += 1
print(ans)

from itertools import permutations
from math import factorial

n, m = list(map(int, input().split(" ")))
edge = []
for i in range(m):
    ai, bi = list(map(int, input().split(" ")))
    edge.append([ai, bi])
l = [i for i in range(1, n + 1)]
ls = list(permutations(l))
ans = 0
for i in range(factorial(n - 1)):
    y = 0
    for j in range(n - 1):
        for k in edge:
            if (ls[i][j + 1] in k) and (ls[i][j] in k):
                y += 1
    if y == n - 1:
        ans += 1
print(ans)

-x = [i for i in range(1, n + 1)] -ls = list(permutations(x)) +l = [i for i in range(1, n + 1)] +ls = list(permutations(l)) -for l in range(factorial(n - 1)): -    cnt = 0 -    for i in range(n - 1): -        for j in range(m): -            if (ls[l][i] in edge[j]) and (ls[l][i + 1] in edge[j]): -                cnt += 1 -    if cnt == n - 1: +for i in range(factorial(n - 1)): +    y = 0 +    for j in range(n - 1): +        for k in edge: +            if (ls[i][j + 1] in k) and (ls[i][j] in k): +                y += 1 +    if y == n - 1: