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

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





for i in range(m):

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

    a -=1

    b-=1

    graph[a].append(b)

    graph[b].append(a)

def all_visited(l):

    a = 0

    for i in range(n):

        if l[i]:

            a+=1

    if a == n:

        return 1

    else: return 0

def dfs(now):



    ans = 0

    visited[now] = 1

  

    if all_visited(visited):

        

        return 1

    for next in graph[now]:

        if visited[next]:continue

        ans += dfs(next)

        visited[next] =0

    return ans

visited = [0]*n

print((dfs(0)))
import sys



sys.setrecursionlimit(10**8)

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

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

visited = [0]*n

def all_v(visited):

    cnt = 0

    for x in visited:cnt+=x

    return cnt == n

def dfs(now):

    visited[now] = 1

    if all_v(visited):return 1

    res = 0

    for next in graph[now]:

        if visited[next]:continue

        res += dfs(next)

        visited[next] = 0

    return res

    

for i in range(m):

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

    a-=1

    b -= 1

    graph[a].append(b)

    graph[b].append(a)

print((dfs(0)))

n, m = list(map(int, input().split()))
graph = [[] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)


def all_visited(l):
    a = 0
    for i in range(n):
        if l[i]:
            a += 1
    if a == n:
        return 1
    else:
        return 0


def dfs(now):
    ans = 0
    visited[now] = 1
    if all_visited(visited):
        return 1
    for next in graph[now]:
        if visited[next]:
            continue
        ans += dfs(next)
        visited[next] = 0
    return ans


visited = [0] * n
print((dfs(0)))

import sys

sys.setrecursionlimit(10**8)
n, m = list(map(int, input().split()))
graph = [[] for i in range(n)]
visited = [0] * n


def all_v(visited):
    cnt = 0
    for x in visited:
        cnt += x
    return cnt == n


def dfs(now):
    visited[now] = 1
    if all_v(visited):
        return 1
    res = 0
    for next in graph[now]:
        if visited[next]:
            continue
        res += dfs(next)
        visited[next] = 0
    return res


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

+import sys + +sys.setrecursionlimit(10**8) +visited = [0] * n + + +def all_v(visited): +    cnt = 0 +    for x in visited: +        cnt += x +    return cnt == n + + +def dfs(now): +    visited[now] = 1 +    if all_v(visited): +        return 1 +    res = 0 +    for next in graph[now]: +        if visited[next]: +            continue +        res += dfs(next) +        visited[next] = 0 +    return res + + - - -def all_visited(l): -    a = 0 -    for i in range(n): -        if l[i]: -            a += 1 -    if a == n: -        return 1 -    else: -        return 0 - - -def dfs(now): -    ans = 0 -    visited[now] = 1 -    if all_visited(visited): -        return 1 -    for next in graph[now]: -        if visited[next]: -            continue -        ans += dfs(next) -        visited[next] = 0 -    return ans - - -visited = [0] * n