import sys

import itertools

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

ab=[]

for _ in range(m):

    ab.append(list(map(int,input().split())))



lis=list(range(1,n+1))

per_lis =[i for i in list(itertools.permutations(lis)) if i[0]==1]



ans=0



for one_case in per_lis:

    tmp=0

    for j in range(n-1):

        for num in ab:

            if one_case[j]==num[0] and one_case[j+1]==num[1]:

                tmp+=1

            elif one_case[j]==num[1] and one_case[j+1]==num[0]:

                tmp+=1

                    



        if tmp==n-1:

            ans+=1



print(ans)



        





import sys

import math

import itertools

import statistics

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

side=[]

for _ in range(m):

    side.append(tuple(map(int,input().split())))

per_lis =[i for i in list(itertools.permutations(list(range(1,n+1)))) if i[0]==1]

ans=0

for one_case in per_lis:

    tmp=0

    for i in range(n-1):

        if ((one_case[i],one_case[i+1]) in side) or ((one_case[i+1],one_case[i]) in side):

            tmp+=1

    if tmp==n-1:

        ans+=1

print(ans)



import sys
import itertools

n, m = list(map(int, input().split()))
ab = []
for _ in range(m):
    ab.append(list(map(int, input().split())))
lis = list(range(1, n + 1))
per_lis = [i for i in list(itertools.permutations(lis)) if i[0] == 1]
ans = 0
for one_case in per_lis:
    tmp = 0
    for j in range(n - 1):
        for num in ab:
            if one_case[j] == num[0] and one_case[j + 1] == num[1]:
                tmp += 1
            elif one_case[j] == num[1] and one_case[j + 1] == num[0]:
                tmp += 1
        if tmp == n - 1:
            ans += 1
print(ans)

import sys
import math
import itertools
import statistics

n, m = list(map(int, input().split()))
side = []
for _ in range(m):
    side.append(tuple(map(int, input().split())))
per_lis = [i for i in list(itertools.permutations(list(range(1, n + 1)))) if i[0] == 1]
ans = 0
for one_case in per_lis:
    tmp = 0
    for i in range(n - 1):
        if ((one_case[i], one_case[i + 1]) in side) or (
            (one_case[i + 1], one_case[i]) in side
        ):
            tmp += 1
    if tmp == n - 1:
        ans += 1
print(ans)

+import math +import statistics -ab = [] +side = [] -    ab.append(list(map(int, input().split()))) -lis = list(range(1, n + 1)) -per_lis = [i for i in list(itertools.permutations(lis)) if i[0] == 1] +    side.append(tuple(map(int, input().split()))) +per_lis = [i for i in list(itertools.permutations(list(range(1, n + 1)))) if i[0] == 1] -    for j in range(n - 1): -        for num in ab: -            if one_case[j] == num[0] and one_case[j + 1] == num[1]: -                tmp += 1 -            elif one_case[j] == num[1] and one_case[j + 1] == num[0]: -                tmp += 1 -        if tmp == n - 1: -            ans += 1 +    for i in range(n - 1): +        if ((one_case[i], one_case[i + 1]) in side) or ( +            (one_case[i + 1], one_case[i]) in side +        ): +            tmp += 1 +    if tmp == n - 1: +        ans += 1