import itertools



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

path={i+1:[] for i in range(n)}

for i in range(m):

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

    path[u].append(v)

    path[v].append(u)

chk=[i for i in range(2,n+1)]

ans=0

for way in list(itertools.permutations(chk)):

    now=1

    if way[0] in path[now]:

        f=1

        for j in way:

            if j in path[now]:

                now=j

                f+=1

            else:

                break

        if f==n: ans+=1

print(ans)
import itertools

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

l=[[0]*n for i in range(n)]

for i in range(m):

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

    l[a-1][b-1]=1

    l[b-1][a-1]=1

d=[int(i)+1 for i in range(n)]

ans=chk=0

for i in list(itertools.permutations(d,n)):

    chk=1

    if i[0]!=1: continue

    for j in range(n-1):

        chk*=l[i[j+1]-1][i[j]-1]

    ans+=chk

print(ans)
import itertools

n, m = list(map(int, input().split()))
path = {i + 1: [] for i in range(n)}
for i in range(m):
    u, v = list(map(int, input().split()))
    path[u].append(v)
    path[v].append(u)
chk = [i for i in range(2, n + 1)]
ans = 0
for way in list(itertools.permutations(chk)):
    now = 1
    if way[0] in path[now]:
        f = 1
        for j in way:
            if j in path[now]:
                now = j
                f += 1
            else:
                break
        if f == n:
            ans += 1
print(ans)

import itertools

n, m = list(map(int, input().split()))
l = [[0] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    l[a - 1][b - 1] = 1
    l[b - 1][a - 1] = 1
d = [int(i) + 1 for i in range(n)]
ans = chk = 0
for i in list(itertools.permutations(d, n)):
    chk = 1
    if i[0] != 1:
        continue
    for j in range(n - 1):
        chk *= l[i[j + 1] - 1][i[j] - 1]
    ans += chk
print(ans)

-path = {i + 1: [] for i in range(n)} +l = [[0] * n for i in range(n)] -    u, v = list(map(int, input().split())) -    path[u].append(v) -    path[v].append(u) -chk = [i for i in range(2, n + 1)] -ans = 0 -for way in list(itertools.permutations(chk)): -    now = 1 -    if way[0] in path[now]: -        f = 1 -        for j in way: -            if j in path[now]: -                now = j -                f += 1 -            else: -                break -        if f == n: -            ans += 1 +    a, b = list(map(int, input().split())) +    l[a - 1][b - 1] = 1 +    l[b - 1][a - 1] = 1 +d = [int(i) + 1 for i in range(n)] +ans = chk = 0 +for i in list(itertools.permutations(d, n)): +    chk = 1 +    if i[0] != 1: +        continue +    for j in range(n - 1): +        chk *= l[i[j + 1] - 1][i[j] - 1] +    ans += chk