import sys

sys.setrecursionlimit(10000)

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

rel = [[False for i in range(n+1)] for i in range(n+1)]

for i in range(m):

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

    rel[a][b] = True

    rel[b][a] = True



ans=0

def rec(l):

    global ans

    if(len(l)==n):

        ans+=1

    x = l[-1]

    for i in range(1,n+1):

        if(i in l):

            continue

        if(rel[x][i]):

            rec(l+[i])



rec([1])

print(ans)
from itertools import permutations

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



rel_t = [[False for i in range(n)] for j in range(n)]



for i in range(m):

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

    rel_t[a-1][b-1]=True

    rel_t[b-1][a-1]=True



cnt=0

n_list = [i for i in range(n)]

for l in permutations(n_list,len(n_list)):

    if(l[0]!=0):

        continue

    judge=[rel_t[l[i]][l[i+1]] for i in range(n-1)]

    if all(judge):

        cnt+=1



print(cnt)
import sys

sys.setrecursionlimit(10000)
n, m = list(map(int, input().split()))
rel = [[False for i in range(n + 1)] for i in range(n + 1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    rel[a][b] = True
    rel[b][a] = True
ans = 0


def rec(l):
    global ans
    if len(l) == n:
        ans += 1
    x = l[-1]
    for i in range(1, n + 1):
        if i in l:
            continue
        if rel[x][i]:
            rec(l + [i])


rec([1])
print(ans)

from itertools import permutations

n, m = list(map(int, input().split()))
rel_t = [[False for i in range(n)] for j in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    rel_t[a - 1][b - 1] = True
    rel_t[b - 1][a - 1] = True
cnt = 0
n_list = [i for i in range(n)]
for l in permutations(n_list, len(n_list)):
    if l[0] != 0:
        continue
    judge = [rel_t[l[i]][l[i + 1]] for i in range(n - 1)]
    if all(judge):
        cnt += 1
print(cnt)

-import sys +from itertools import permutations -sys.setrecursionlimit(10000) -rel = [[False for i in range(n + 1)] for i in range(n + 1)] +rel_t = [[False for i in range(n)] for j in range(n)] -    rel[a][b] = True -    rel[b][a] = True -ans = 0 - - -def rec(l): -    global ans -    if len(l) == n: -        ans += 1 -    x = l[-1] -    for i in range(1, n + 1): -        if i in l: -            continue -        if rel[x][i]: -            rec(l + [i]) - - -rec([1]) -print(ans) +    rel_t[a - 1][b - 1] = True +    rel_t[b - 1][a - 1] = True +cnt = 0 +n_list = [i for i in range(n)] +for l in permutations(n_list, len(n_list)): +    if l[0] != 0: +        continue +    judge = [rel_t[l[i]][l[i + 1]] for i in range(n - 1)] +    if all(judge): +        cnt += 1 +print(cnt)