import os,re,sys,operator

from collections import Counter,deque

from operator import itemgetter

from itertools import accumulate,combinations,groupby

from sys import stdin,setrecursionlimit

from copy import deepcopy

import heapq



setrecursionlimit(10**6)



def dfs(now,depth):

    global used

    global gragh

    global n

    ans=0



    if used[now]:

        return 0

    if depth==n:

        return 1

    used[now]=1

    for i in range(n):

        if gragh[now][i]:

            ans+=dfs(i,depth+1)

    used[now]=0

    return ans



n,m=list(map(int,stdin.readline().rstrip().split()))

gragh=[[0]*n for _ in range(n)]



for i in range(m):

    a,b=list(map(int,stdin.readline().rstrip().split()))

    gragh[a-1][b-1]=gragh[b-1][a-1]=1



used=[0]*n

print((dfs(0,1)))
import sys

sys.setrecursionlimit(10**6)



input=sys.stdin.readline



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

G=[[False]*n for _ in range(n)]

used=[False]*n



def dfs(now,depth):

    if used[now]:

        return 0

    if n==depth:

        return 1

    used[now]=True

    ans=0

    for i in range(n):

        if G[now][i]:

            ans+=dfs(i,depth+1)

    used[now]=False

    return ans



for _ in range(m):

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

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

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



print((dfs(0,1)))
import os, re, sys, operator
from collections import Counter, deque
from operator import itemgetter
from itertools import accumulate, combinations, groupby
from sys import stdin, setrecursionlimit
from copy import deepcopy
import heapq

setrecursionlimit(10**6)


def dfs(now, depth):
    global used
    global gragh
    global n
    ans = 0
    if used[now]:
        return 0
    if depth == n:
        return 1
    used[now] = 1
    for i in range(n):
        if gragh[now][i]:
            ans += dfs(i, depth + 1)
    used[now] = 0
    return ans


n, m = list(map(int, stdin.readline().rstrip().split()))
gragh = [[0] * n for _ in range(n)]
for i in range(m):
    a, b = list(map(int, stdin.readline().rstrip().split()))
    gragh[a - 1][b - 1] = gragh[b - 1][a - 1] = 1
used = [0] * n
print((dfs(0, 1)))

import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline
n, m = list(map(int, input().split()))
G = [[False] * n for _ in range(n)]
used = [False] * n


def dfs(now, depth):
    if used[now]:
        return 0
    if n == depth:
        return 1
    used[now] = True
    ans = 0
    for i in range(n):
        if G[now][i]:
            ans += dfs(i, depth + 1)
    used[now] = False
    return ans


for _ in range(m):
    a, b = list(map(int, input().split()))
    G[a - 1][b - 1] = True
    G[b - 1][a - 1] = True
print((dfs(0, 1)))

-import os, re, sys, operator -from collections import Counter, deque -from operator import itemgetter -from itertools import accumulate, combinations, groupby -from sys import stdin, setrecursionlimit -from copy import deepcopy -import heapq +import sys -setrecursionlimit(10**6) +sys.setrecursionlimit(10**6) +input = sys.stdin.readline +n, m = list(map(int, input().split())) +G = [[False] * n for _ in range(n)] +used = [False] * n -    global used -    global gragh -    global n -    ans = 0 -    if depth == n: +    if n == depth: -    used[now] = 1 +    used[now] = True +    ans = 0 -        if gragh[now][i]: +        if G[now][i]: -    used[now] = 0 +    used[now] = False -n, m = list(map(int, stdin.readline().rstrip().split())) -gragh = [[0] * n for _ in range(n)] -for i in range(m): -    a, b = list(map(int, stdin.readline().rstrip().split())) -    gragh[a - 1][b - 1] = gragh[b - 1][a - 1] = 1 -used = [0] * n +for _ in range(m): +    a, b = list(map(int, input().split())) +    G[a - 1][b - 1] = True +    G[b - 1][a - 1] = True