from itertools import permutations

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

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



ans = 0

for i in permutations(list(range(2, n+1)), n-1):

    load = [1]+list(i)

    ans += sum(1 for edge in zip(load, load[1:])

               if tuple(sorted(edge)) in edges) == n-1

print(ans)

from itertools import permutations

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

edges = {tuple(map(int, input().split())) for _ in range(m)}



ans = 0

for i in permutations(list(range(2, n+1)), n-1):

    load = [1]+list(i)

    ans += sum(1 for edge in zip(load, load[1:])

               if tuple(sorted(edge)) in edges) == n-1

print(ans)

from itertools import permutations

n, m = list(map(int, input().split()))
edges = [tuple(map(int, input().split())) for _ in range(m)]
ans = 0
for i in permutations(list(range(2, n + 1)), n - 1):
    load = [1] + list(i)
    ans += (
        sum(1 for edge in zip(load, load[1:]) if tuple(sorted(edge)) in edges) == n - 1
    )
print(ans)

from itertools import permutations

n, m = list(map(int, input().split()))
edges = {tuple(map(int, input().split())) for _ in range(m)}
ans = 0
for i in permutations(list(range(2, n + 1)), n - 1):
    load = [1] + list(i)
    ans += (
        sum(1 for edge in zip(load, load[1:]) if tuple(sorted(edge)) in edges) == n - 1
    )
print(ans)

-edges = [tuple(map(int, input().split())) for _ in range(m)] +edges = {tuple(map(int, input().split())) for _ in range(m)}