import itertools

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

A=[]

for _ in range(a-1):

  A.append(_+2)

List=[list(map(int,input().split())) for i in range(b)]

count=0

for i in itertools.permutations(A):

  ju=True

  if [1,i[0]] in List or [i[0],1] in List:

    ju=True

  else:

    ju=False

  for j in range(a-2):

    if not([i[j],i[j+1]] in List) and not([i[j+1],i[j]] in List):

      ju=False

  if ju:

    count+=1

print(count)
import math

import sys

from collections import deque

import copy

import itertools

from itertools import permutations

def mi() : return list(map(int,input().split()))

def i() : return int(eval(input()))

a,b=mi()

ans=0

l=[[] for _ in range(a)]

for i in range(b):

  u,v=mi()

  l[u-1].append(v-1)

  l[v-1].append(u-1)

S=[]

for i in range(1,a):

  S.append(i)

lst=list(permutations(S))

for i in lst:

  x=0

  t=True

  for w in range(len(i)):

    if not i[w] in l[x]:

      t=False

      break

    x=i[w]

  if t:

    ans+=1

print(ans)
import itertools

a, b = list(map(int, input().split()))
A = []
for _ in range(a - 1):
    A.append(_ + 2)
List = [list(map(int, input().split())) for i in range(b)]
count = 0
for i in itertools.permutations(A):
    ju = True
    if [1, i[0]] in List or [i[0], 1] in List:
        ju = True
    else:
        ju = False
    for j in range(a - 2):
        if not ([i[j], i[j + 1]] in List) and not ([i[j + 1], i[j]] in List):
            ju = False
    if ju:
        count += 1
print(count)

import math
import sys
from collections import deque
import copy
import itertools
from itertools import permutations


def mi():
    return list(map(int, input().split()))


def i():
    return int(eval(input()))


a, b = mi()
ans = 0
l = [[] for _ in range(a)]
for i in range(b):
    u, v = mi()
    l[u - 1].append(v - 1)
    l[v - 1].append(u - 1)
S = []
for i in range(1, a):
    S.append(i)
lst = list(permutations(S))
for i in lst:
    x = 0
    t = True
    for w in range(len(i)):
        if not i[w] in l[x]:
            t = False
            break
        x = i[w]
    if t:
        ans += 1
print(ans)

+import math +import sys +from collections import deque +import copy +from itertools import permutations -a, b = list(map(int, input().split())) -A = [] -for _ in range(a - 1): -    A.append(_ + 2) -List = [list(map(int, input().split())) for i in range(b)] -count = 0 -for i in itertools.permutations(A): -    ju = True -    if [1, i[0]] in List or [i[0], 1] in List: -        ju = True -    else: -        ju = False -    for j in range(a - 2): -        if not ([i[j], i[j + 1]] in List) and not ([i[j + 1], i[j]] in List): -            ju = False -    if ju: -        count += 1 -print(count) + +def mi(): +    return list(map(int, input().split())) + + +def i(): +    return int(eval(input())) + + +a, b = mi() +ans = 0 +l = [[] for _ in range(a)] +for i in range(b): +    u, v = mi() +    l[u - 1].append(v - 1) +    l[v - 1].append(u - 1) +S = [] +for i in range(1, a): +    S.append(i) +lst = list(permutations(S)) +for i in lst: +    x = 0 +    t = True +    for w in range(len(i)): +        if not i[w] in l[x]: +            t = False +            break +        x = i[w] +    if t: +        ans += 1 +print(ans)