import itertools

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

path=[[False]*n for i in range(n)]

for i in range(m):

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

    a-=1

    b-=1

    path[a][b]=True

    path[b][a]=True

ans=0;



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

    if i[0]==0:

        for j in range(n):

            if j==n-1:

                ans+=1

                break

            if not path[i[j]][i[j+1]]:

                break

print(ans)
def dfs(a,count,seen):

    nseen=seen[:]

    ans=0

    nseen[a] = 1;

    if count==n-1:

        return 1

    else:

        for i in g[a]:

            if not seen[i]:

                ans+=dfs(i,count+1,nseen)

        return ans

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

g=[[]*n for i in range(n)]

for i in range(m):

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

    a-=1

    b-=1

    g[a].append(b)

    g[b].append(a)

seen=[0]*n

print((dfs(0,0,seen)))

import itertools

n, m = list(map(int, input().split()))
path = [[False] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True
ans = 0
for i in itertools.permutations(list(range(n)), n):
    if i[0] == 0:
        for j in range(n):
            if j == n - 1:
                ans += 1
                break
            if not path[i[j]][i[j + 1]]:
                break
print(ans)

def dfs(a, count, seen):
    nseen = seen[:]
    ans = 0
    nseen[a] = 1
    if count == n - 1:
        return 1
    else:
        for i in g[a]:
            if not seen[i]:
                ans += dfs(i, count + 1, nseen)
        return ans


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

-import itertools +def dfs(a, count, seen): +    nseen = seen[:] +    ans = 0 +    nseen[a] = 1 +    if count == n - 1: +        return 1 +    else: +        for i in g[a]: +            if not seen[i]: +                ans += dfs(i, count + 1, nseen) +        return ans + -path = [[False] * n for i in range(n)] +g = [[] * n for i in range(n)] -    path[a][b] = True -    path[b][a] = True -ans = 0 -for i in itertools.permutations(list(range(n)), n): -    if i[0] == 0: -        for j in range(n): -            if j == n - 1: -                ans += 1 -                break -            if not path[i[j]][i[j + 1]]: -                break -print(ans) +    g[a].append(b) +    g[b].append(a) +seen = [0] * n +print((dfs(0, 0, seen)))