from itertools import permutations



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

es=set()

for _ in range(m):

    u,v=list(map(int,input().split()))

    u,v=u-1,v-1

    es|={(u,v),(v,u)}



res=0

for p in permutations(list(range(n))):

    if p[0]!=0: continue

    if all((p[i],p[i+1]) in es for i in range(n-1)):

        res+=1

print(res)

from itertools import permutations



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

es=set()

for _ in range(m):

    u,v=list(map(int,input().split()))

    es|={(u-1,v-1),(v-1,u-1)}



print((sum(all((u,v) in es for u,v in zip(p,p[1:]))

          for p in permutations(list(range(n))) if p[0]==0)))

from itertools import permutations

n, m = list(map(int, input().split()))
es = set()
for _ in range(m):
    u, v = list(map(int, input().split()))
    u, v = u - 1, v - 1
    es |= {(u, v), (v, u)}
res = 0
for p in permutations(list(range(n))):
    if p[0] != 0:
        continue
    if all((p[i], p[i + 1]) in es for i in range(n - 1)):
        res += 1
print(res)

from itertools import permutations

n, m = list(map(int, input().split()))
es = set()
for _ in range(m):
    u, v = list(map(int, input().split()))
    es |= {(u - 1, v - 1), (v - 1, u - 1)}
print(
    (
        sum(
            all((u, v) in es for u, v in zip(p, p[1:]))
            for p in permutations(list(range(n)))
            if p[0] == 0
        )
    )
)

-    u, v = u - 1, v - 1 -    es |= {(u, v), (v, u)} -res = 0 -for p in permutations(list(range(n))): -    if p[0] != 0: -        continue -    if all((p[i], p[i + 1]) in es for i in range(n - 1)): -        res += 1 -print(res) +    es |= {(u - 1, v - 1), (v - 1, u - 1)} +print( +    ( +        sum( +            all((u, v) in es for u, v in zip(p, p[1:])) +            for p in permutations(list(range(n))) +            if p[0] == 0 +        ) +    ) +)