from collections import defaultdict

import itertools



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

connected_dict = defaultdict(lambda: [])



for i in range(m):

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

    connected_dict[a].append(b)

    connected_dict[b].append(a)



count = 0

for permutation in list(itertools.permutations(list(range(2, n + 1)))):

    flag = True

    pre_num = 1

    for num in permutation:

        if num not in connected_dict[pre_num]:

            flag = False

            break

        pre_num = num

    if flag:

        count += 1

print(count)

# One-stroke Path

import itertools

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

ab = {}

for i in range(n+1):

    ab[i] = []

for i in range(m):

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

    ab[a].append(b)

    ab[b].append(a)



count = 0



for values in list(itertools.permutations(list(range(2, n+1)))):

    pre = 1

    for i, v in enumerate(values):

        if(v not in ab[pre]):

            break

        if i == n-2:

            count += 1

        pre = v

print(count)
from collections import defaultdict
import itertools

n, m = list(map(int, input().split()))
connected_dict = defaultdict(lambda: [])
for i in range(m):
    a, b = list(map(int, input().split()))
    connected_dict[a].append(b)
    connected_dict[b].append(a)
count = 0
for permutation in list(itertools.permutations(list(range(2, n + 1)))):
    flag = True
    pre_num = 1
    for num in permutation:
        if num not in connected_dict[pre_num]:
            flag = False
            break
        pre_num = num
    if flag:
        count += 1
print(count)

# One-stroke Path
import itertools

n, m = list(map(int, input().split()))
ab = {}
for i in range(n + 1):
    ab[i] = []
for i in range(m):
    a, b = list(map(int, input().split()))
    ab[a].append(b)
    ab[b].append(a)
count = 0
for values in list(itertools.permutations(list(range(2, n + 1)))):
    pre = 1
    for i, v in enumerate(values):
        if v not in ab[pre]:
            break
        if i == n - 2:
            count += 1
        pre = v
print(count)

-from collections import defaultdict +# One-stroke Path -connected_dict = defaultdict(lambda: []) +ab = {} +for i in range(n + 1): +    ab[i] = [] -    connected_dict[a].append(b) -    connected_dict[b].append(a) +    ab[a].append(b) +    ab[b].append(a) -for permutation in list(itertools.permutations(list(range(2, n + 1)))): -    flag = True -    pre_num = 1 -    for num in permutation: -        if num not in connected_dict[pre_num]: -            flag = False +for values in list(itertools.permutations(list(range(2, n + 1)))): +    pre = 1 +    for i, v in enumerate(values): +        if v not in ab[pre]: -        pre_num = num -    if flag: -        count += 1 +        if i == n - 2: +            count += 1 +        pre = v