import itertools



N, M = list(map(int, input().split()))

ab=[]

for _ in range(M):

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



lst=[[] for _ in range(N+1)]

for el in ab:

    lst[el[0]].append(el[1])

    lst[el[1]].append(el[0])

#print(lst)



count=0

for permu in itertools.permutations(list(range(1,N+1))):

    if permu[0] == 1:

        for i in range(0,N-1):

            if permu[i+1] in lst[permu[i]]:

                pass

            else:

                break

        else:

            count+=1

            #print(permu)

print(count)



N, M = list(map(int, input().split()))

ab=[]

for _ in range(M):

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



lst=[[] for _ in range(N+1)]

for el in ab:

    lst[el[0]].append(el[1])

    lst[el[1]].append(el[0])

#print(lst)



seen=[False]*(N+1)

todo=[]





counter=0

def func(n):

    global counter

    #print(n, seen, seen.count(True), counter)

    if seen.count(True)==N:

        counter+=1

        #print(counter)



    seen[n]=True

    for val in lst[n]:

        if seen[val]==False:

            seen[val]=True

            func(val)

            seen[val]=False

func(1)

print(counter)

import itertools

N, M = list(map(int, input().split()))
ab = []
for _ in range(M):
    ab.append(tuple(map(int, input().split())))
lst = [[] for _ in range(N + 1)]
for el in ab:
    lst[el[0]].append(el[1])
    lst[el[1]].append(el[0])
# print(lst)
count = 0
for permu in itertools.permutations(list(range(1, N + 1))):
    if permu[0] == 1:
        for i in range(0, N - 1):
            if permu[i + 1] in lst[permu[i]]:
                pass
            else:
                break
        else:
            count += 1
            # print(permu)
print(count)

N, M = list(map(int, input().split()))
ab = []
for _ in range(M):
    ab.append(tuple(map(int, input().split())))
lst = [[] for _ in range(N + 1)]
for el in ab:
    lst[el[0]].append(el[1])
    lst[el[1]].append(el[0])
# print(lst)
seen = [False] * (N + 1)
todo = []
counter = 0


def func(n):
    global counter
    # print(n, seen, seen.count(True), counter)
    if seen.count(True) == N:
        counter += 1
        # print(counter)
    seen[n] = True
    for val in lst[n]:
        if seen[val] == False:
            seen[val] = True
            func(val)
            seen[val] = False


func(1)
print(counter)

-import itertools - -count = 0 -for permu in itertools.permutations(list(range(1, N + 1))): -    if permu[0] == 1: -        for i in range(0, N - 1): -            if permu[i + 1] in lst[permu[i]]: -                pass -            else: -                break -        else: -            count += 1 -            # print(permu) -print(count) +seen = [False] * (N + 1) +todo = [] +counter = 0 + + +def func(n): +    global counter +    # print(n, seen, seen.count(True), counter) +    if seen.count(True) == N: +        counter += 1 +        # print(counter) +    seen[n] = True +    for val in lst[n]: +        if seen[val] == False: +            seen[val] = True +            func(val) +            seen[val] = False + + +func(1) +print(counter)