# 入力

import sys

stdin = sys.stdin



def li(): return [int(x) for x in stdin.readline().split()]

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return [float(x) for x in stdin.readline().split()]

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(ns())

def nf(): return float(ns())



from itertools import permutations



# 全探索をするのです

n,m = li()

edges = set()

for _ in range(m):

    a,b = li()

    edges.add((a,b))

    edges.add((b,a))

    

paths = permutations([str(i) for i in range(2,n+1)],n-1)

cnt = 0

for path in paths:

    path = [1] + [int(i) for i in path]

    

    exist = True

    for i in range(n-1):

        if not (path[i], path[i+1]) in edges:

            exist = False



    if exist:

        cnt += 1

        

print(cnt)
import sys

stdin = sys.stdin

 

sys.setrecursionlimit(10**5) 

 

def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



from itertools import permutations



n,m = li()

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



for _ in range(m):

    a,b = li_()

    graph[a][b] = True

    graph[b][a] = True

    

cands = list(permutations([i for i in range(1,n)]))



ans = 0



for c in cands:

    cand = [0] + list(c)

    ok = True

    for i in range(n-1):

        if not graph[cand[i+1]][cand[i]]:

            ok = False

    

    if ok:   

        ans += 1

    

print(ans)
# 入力
import sys

stdin = sys.stdin


def li():
    return [int(x) for x in stdin.readline().split()]


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return [float(x) for x in stdin.readline().split()]


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(ns())


def nf():
    return float(ns())


from itertools import permutations

# 全探索をするのです
n, m = li()
edges = set()
for _ in range(m):
    a, b = li()
    edges.add((a, b))
    edges.add((b, a))
paths = permutations([str(i) for i in range(2, n + 1)], n - 1)
cnt = 0
for path in paths:
    path = [1] + [int(i) for i in path]
    exist = True
    for i in range(n - 1):
        if not (path[i], path[i + 1]) in edges:
            exist = False
    if exist:
        cnt += 1
print(cnt)

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**5)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


from itertools import permutations

n, m = li()
graph = [[False] * n for _ in range(n)]
for _ in range(m):
    a, b = li_()
    graph[a][b] = True
    graph[b][a] = True
cands = list(permutations([i for i in range(1, n)]))
ans = 0
for c in cands:
    cand = [0] + list(c)
    ok = True
    for i in range(n - 1):
        if not graph[cand[i + 1]][cand[i]]:
            ok = False
    if ok:
        ans += 1
print(ans)

-# 入力 +sys.setrecursionlimit(10**5) -    return [int(x) for x in stdin.readline().split()] +    return list(map(int, stdin.readline().split())) -    return [float(x) for x in stdin.readline().split()] +    return list(map(float, stdin.readline().split())) -    return int(ns()) +    return int(stdin.readline()) -    return float(ns()) +    return float(stdin.readline()) -# 全探索をするのです -edges = set() +graph = [[False] * n for _ in range(n)] -    a, b = li() -    edges.add((a, b)) -    edges.add((b, a)) -paths = permutations([str(i) for i in range(2, n + 1)], n - 1) -cnt = 0 -for path in paths: -    path = [1] + [int(i) for i in path] -    exist = True +    a, b = li_() +    graph[a][b] = True +    graph[b][a] = True +cands = list(permutations([i for i in range(1, n)])) +ans = 0 +for c in cands: +    cand = [0] + list(c) +    ok = True -        if not (path[i], path[i + 1]) in edges: -            exist = False -    if exist: -        cnt += 1 -print(cnt) +        if not graph[cand[i + 1]][cand[i]]: +            ok = False +    if ok: +        ans += 1 +print(ans)