from collections import defaultdict, deque, Counter

from heapq import heappush, heappop, heapify

import math

import bisect

import random

from itertools import permutations, accumulate, combinations

import sys

import string

from bisect import bisect_left, bisect_right

from math import factorial, ceil, floor

from functools import reduce









INF = float('inf')

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

def I(): return int(sys.stdin.readline())

def LS(): return sys.stdin.readline().split()

def S(): return sys.stdin.readline().strip()

def IR(n): return [I() for i in range(n)]

def LIR(n): return [LI() for i in range(n)]

def SR(n): return [S() for i in range(n)]

def LSR(n): return [LS() for i in range(n)]

def SRL(n): return [list(S()) for i in range(n)]

def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod = 1000000007





n, m = LI()

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

for a, b in LIR(m):

    graph[a-1] += [b-1]

    graph[b- 1] += [a - 1]







cnt = 0



for l in list(permutations(list(range(n)), n)):

    if l[0]:

        continue

    for i in range(n-1):

        if not l[i+1] in graph[l[i]]:

            break

    else:

        cnt += 1







print(cnt)
from collections import defaultdict, deque, Counter

from heapq import heappush, heappop, heapify

import math

import bisect

import random

from itertools import permutations, accumulate, combinations, product

import sys

from pprint import pprint

from copy import deepcopy

import string

from bisect import bisect_left, bisect_right

from math import factorial, ceil, floor

from operator import mul

from functools import reduce

from pprint import pprint





sys.setrecursionlimit(2147483647)

INF = 10 ** 13

def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

def I(): return int(sys.stdin.buffer.readline())

def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

def IR(n): return [I() for i in range(n)]

def LIR(n): return [LI() for i in range(n)]

def SR(n): return [S() for i in range(n)]

def LSR(n): return [LS() for i in range(n)]

def SRL(n): return [list(S()) for i in range(n)]

def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod = 100000000



n, m = LI()

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

for u, v in LIR(m):

    G[u - 1][v - 1] = 1

    G[v - 1][u - 1] = 1





cnt = 0

for path in permutations(list(range(1, n))):

    for i in range(1, len(path)):

        if not G[path[i - 1]][path[i]]:

            break

    else:

        if G[0][path[0]]:

            cnt += 1



print(cnt)
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce

INF = float("inf")


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


def I():
    return int(sys.stdin.readline())


def LS():
    return sys.stdin.readline().split()


def S():
    return sys.stdin.readline().strip()


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


def SRL(n):
    return [list(S()) for i in range(n)]


def MSRL(n):
    return [[int(j) for j in list(S())] for i in range(n)]


mod = 1000000007
n, m = LI()
graph = [[] for _ in range(n)]
for a, b in LIR(m):
    graph[a - 1] += [b - 1]
    graph[b - 1] += [a - 1]
cnt = 0
for l in list(permutations(list(range(n)), n)):
    if l[0]:
        continue
    for i in range(n - 1):
        if not l[i + 1] in graph[l[i]]:
            break
    else:
        cnt += 1
print(cnt)

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint

sys.setrecursionlimit(2147483647)
INF = 10**13


def LI():
    return list(map(int, sys.stdin.buffer.readline().split()))


def I():
    return int(sys.stdin.buffer.readline())


def LS():
    return sys.stdin.buffer.readline().rstrip().decode("utf-8").split()


def S():
    return sys.stdin.buffer.readline().rstrip().decode("utf-8")


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


def SRL(n):
    return [list(S()) for i in range(n)]


def MSRL(n):
    return [[int(j) for j in list(S())] for i in range(n)]


mod = 100000000
n, m = LI()
G = [[0] * n for _ in range(n)]
for u, v in LIR(m):
    G[u - 1][v - 1] = 1
    G[v - 1][u - 1] = 1
cnt = 0
for path in permutations(list(range(1, n))):
    for i in range(1, len(path)):
        if not G[path[i - 1]][path[i]]:
            break
    else:
        if G[0][path[0]]:
            cnt += 1
print(cnt)

-from itertools import permutations, accumulate, combinations +from itertools import permutations, accumulate, combinations, product +from pprint import pprint +from copy import deepcopy +from operator import mul +from pprint import pprint -INF = float("inf") +sys.setrecursionlimit(2147483647) +INF = 10**13 -    return list(map(int, sys.stdin.readline().split())) +    return list(map(int, sys.stdin.buffer.readline().split())) -    return int(sys.stdin.readline()) +    return int(sys.stdin.buffer.readline()) -    return sys.stdin.readline().split() +    return sys.stdin.buffer.readline().rstrip().decode("utf-8").split() -    return sys.stdin.readline().strip() +    return sys.stdin.buffer.readline().rstrip().decode("utf-8") -mod = 1000000007 +mod = 100000000 -graph = [[] for _ in range(n)] -for a, b in LIR(m): -    graph[a - 1] += [b - 1] -    graph[b - 1] += [a - 1] +G = [[0] * n for _ in range(n)] +for u, v in LIR(m): +    G[u - 1][v - 1] = 1 +    G[v - 1][u - 1] = 1 -for l in list(permutations(list(range(n)), n)): -    if l[0]: -        continue -    for i in range(n - 1): -        if not l[i + 1] in graph[l[i]]: +for path in permutations(list(range(1, n))): +    for i in range(1, len(path)): +        if not G[path[i - 1]][path[i]]: -        cnt += 1 +        if G[0][path[0]]: +            cnt += 1