def dfs():

  stack = [[0]]

  count = 0

  while stack:

    route = stack.pop()

    if len(route) == N:

      #print 'route=',route

      count += 1

      continue

    now = route[-1]

    for next in [x for x in range(N) if EDGES[now][x] == 1]:

      #print 'now,next',now,next

      if next in route:

        continue

      newroute = route[:]

      newroute.append(next)

      stack.append(newroute)

  return count



N,M = list(map(int, input().split()))

EDGES = [[0 for i in range(N)] for i in range(N)]

for i in range(M):

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

  EDGES[a-1][b-1] = 1

  EDGES[b-1][a-1] = 1



print(dfs())
import itertools

N,M = list(map(int,input().split()))

es = [[0 for j in range(N)] for i in range(N)]

for i in range(M):

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

    a,b = a-1,b-1

    es[a][b] = es[b][a] = 1



ans = 0

for ptn in itertools.permutations(list(range(1,N))):

    prev = 0

    for v in ptn:

        if not es[prev][v]:

            break

        prev = v

    else:

        ans += 1

print(ans)
def dfs():
    stack = [[0]]
    count = 0
    while stack:
        route = stack.pop()
        if len(route) == N:
            # print 'route=',route
            count += 1
            continue
        now = route[-1]
        for next in [x for x in range(N) if EDGES[now][x] == 1]:
            # print 'now,next',now,next
            if next in route:
                continue
            newroute = route[:]
            newroute.append(next)
            stack.append(newroute)
    return count


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

import itertools

N, M = list(map(int, input().split()))
es = [[0 for j in range(N)] for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    es[a][b] = es[b][a] = 1
ans = 0
for ptn in itertools.permutations(list(range(1, N))):
    prev = 0
    for v in ptn:
        if not es[prev][v]:
            break
        prev = v
    else:
        ans += 1
print(ans)

-def dfs(): -    stack = [[0]] -    count = 0 -    while stack: -        route = stack.pop() -        if len(route) == N: -            # print 'route=',route -            count += 1 -            continue -        now = route[-1] -        for next in [x for x in range(N) if EDGES[now][x] == 1]: -            # print 'now,next',now,next -            if next in route: -                continue -            newroute = route[:] -            newroute.append(next) -            stack.append(newroute) -    return count - +import itertools -EDGES = [[0 for i in range(N)] for i in range(N)] +es = [[0 for j in range(N)] for i in range(N)] -    EDGES[a - 1][b - 1] = 1 -    EDGES[b - 1][a - 1] = 1 -print(dfs()) +    a, b = a - 1, b - 1 +    es[a][b] = es[b][a] = 1 +ans = 0 +for ptn in itertools.permutations(list(range(1, N))): +    prev = 0 +    for v in ptn: +        if not es[prev][v]: +            break +        prev = v +    else: +        ans += 1 +print(ans)