import sys

readline = sys.stdin.buffer.readline



from collections import deque

from copy import copy,deepcopy

from itertools import permutations



def myinput():

    return list(map(int,readline().split()))



def mycol(data,col):

    return [ row[col] for row in data ]



n,m = myinput()

ab = [ list(myinput()) for _ in range(m) ]



v = list(range(1,n+1))

p = list(permutations(v))

# print(p)



count = 0

for s in p:

    # print(s)

    if s[0]!=1:

        pass

    else:

        flag = True

        for j in range(n-1):

            v_tmp = s[j]

            v_next = s[j+1]

            c = [v_tmp,v_next]

            d = [v_next,v_tmp]

            if ( c in ab ) or ( d in ab ):

                pass

            else:

                flag = False



        if flag:

            count += 1

        else:

            pass

    # print(count)



print(count)
from collections import deque

from heapq import heapify,heappop,heappush,heappushpop

from copy import copy,deepcopy

from itertools import product,permutations,combinations,combinations_with_replacement

from collections import defaultdict,Counter

from bisect import bisect_left,bisect_right

# from math import gcd,ceil,floor,factorial

# from fractions import gcd

from functools import reduce

from pprint import pprint



INF = float("inf")



def myinput():

    return list(map(int,input().split()))



def mylistinput(n):

    return [ list(myinput()) for _ in range(n) ]



def mycol(data,col):

    return [ row[col] for row in data ]



def mysort(data,col,reverse_flag):

    data.sort(key=lambda x:x[col],reverse=reverse_flag)

    return data



def mymax(data):

    M = -1*float("inf")

    for i in range(len(data)):

        m = max(data[i])

        M = max(M,m)

    return M



def mymin(data):

    m = float("inf")

    for i in range(len(data)):

        M = min(data[i])

        m = min(m,M)

    return m



def mycount(ls,x):

    # lsはソート済みであること

    l = bisect_left(ls,x)

    r = bisect_right(ls,x)

    return (r-l)



def myoutput(ls,space=True):

    if space:

        if len(ls)==0:

            print(" ")

        elif type(ls[0])==str:

            print((" ".join(ls)))

        elif type(ls[0])==int:

            print((" ".join(map(str,ls))))

        else:

            print("Output Error")

    else:

        if len(ls)==0:

            print("")

        elif type(ls[0])==str:

            print(("".join(ls)))

        elif type(ls[0])==int:

            print(("".join(map(str,ls))))

        else:

            print("Output Error")



def I():

    return int(eval(input()))



def MI():

    return list(map(int,input().split()))



def RI():

    return list(map(int,input().split()))



def CI(n):

    return [ int(eval(input())) for _ in range(n) ]



def LI(n):

    return [ list(map(int,input().split())) for _ in range(n) ]



def S():

    return eval(input())



def MS():

    return input().split()



def RS():

    return list(input().split())



def CS(n):

    return [ eval(input()) for _ in range(n) ]



def LS(n):

    return [ list(input().split()) for _ in range(n) ]



n,m = RI()

ab = LI(m)



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

for i in range(m):

    a = ab[i][0] - 1

    b = ab[i][1] - 1

    g[a].append(b)

    g[b].append(a)

# print(g)



l = list(range(1,n))

ls = list( permutations(l) )

# print(ls)



ans = 0

for i in range(len(ls)):

    flag = True

    v = [0]*n

    p = [0] + list(ls[i])

    # print(p)

    for j in range(len(p)-1):

        if v[p[j]]!=0:

            flag = False

        else:

            if p[j+1] in g[p[j]]:

                v[p[j]] = 1

            else:

                flag = False

    if flag:

        ans += 1

    else:

        pass



print(ans)
import sys

readline = sys.stdin.buffer.readline
from collections import deque
from copy import copy, deepcopy
from itertools import permutations


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


def mycol(data, col):
    return [row[col] for row in data]


n, m = myinput()
ab = [list(myinput()) for _ in range(m)]
v = list(range(1, n + 1))
p = list(permutations(v))
# print(p)
count = 0
for s in p:
    # print(s)
    if s[0] != 1:
        pass
    else:
        flag = True
        for j in range(n - 1):
            v_tmp = s[j]
            v_next = s[j + 1]
            c = [v_tmp, v_next]
            d = [v_next, v_tmp]
            if (c in ab) or (d in ab):
                pass
            else:
                flag = False
        if flag:
            count += 1
        else:
            pass
    # print(count)
print(count)

from collections import deque
from heapq import heapify, heappop, heappush, heappushpop
from copy import copy, deepcopy
from itertools import product, permutations, combinations, combinations_with_replacement
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right

# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

INF = float("inf")


def myinput():
    return list(map(int, input().split()))


def mylistinput(n):
    return [list(myinput()) for _ in range(n)]


def mycol(data, col):
    return [row[col] for row in data]


def mysort(data, col, reverse_flag):
    data.sort(key=lambda x: x[col], reverse=reverse_flag)
    return data


def mymax(data):
    M = -1 * float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M, m)
    return M


def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m, M)
    return m


def mycount(ls, x):
    # lsはソート済みであること
    l = bisect_left(ls, x)
    r = bisect_right(ls, x)
    return r - l


def myoutput(ls, space=True):
    if space:
        if len(ls) == 0:
            print(" ")
        elif type(ls[0]) == str:
            print((" ".join(ls)))
        elif type(ls[0]) == int:
            print((" ".join(map(str, ls))))
        else:
            print("Output Error")
    else:
        if len(ls) == 0:
            print("")
        elif type(ls[0]) == str:
            print(("".join(ls)))
        elif type(ls[0]) == int:
            print(("".join(map(str, ls))))
        else:
            print("Output Error")


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def RI():
    return list(map(int, input().split()))


def CI(n):
    return [int(eval(input())) for _ in range(n)]


def LI(n):
    return [list(map(int, input().split())) for _ in range(n)]


def S():
    return eval(input())


def MS():
    return input().split()


def RS():
    return list(input().split())


def CS(n):
    return [eval(input()) for _ in range(n)]


def LS(n):
    return [list(input().split()) for _ in range(n)]


n, m = RI()
ab = LI(m)
g = [[] for _ in range(n)]
for i in range(m):
    a = ab[i][0] - 1
    b = ab[i][1] - 1
    g[a].append(b)
    g[b].append(a)
# print(g)
l = list(range(1, n))
ls = list(permutations(l))
# print(ls)
ans = 0
for i in range(len(ls)):
    flag = True
    v = [0] * n
    p = [0] + list(ls[i])
    # print(p)
    for j in range(len(p) - 1):
        if v[p[j]] != 0:
            flag = False
        else:
            if p[j + 1] in g[p[j]]:
                v[p[j]] = 1
            else:
                flag = False
    if flag:
        ans += 1
    else:
        pass
print(ans)

-import sys +from collections import deque +from heapq import heapify, heappop, heappush, heappushpop +from copy import copy, deepcopy +from itertools import product, permutations, combinations, combinations_with_replacement +from collections import defaultdict, Counter +from bisect import bisect_left, bisect_right -readline = sys.stdin.buffer.readline -from collections import deque -from copy import copy, deepcopy -from itertools import permutations +# from math import gcd,ceil,floor,factorial +# from fractions import gcd +from functools import reduce +from pprint import pprint + +INF = float("inf") -    return list(map(int, readline().split())) +    return list(map(int, input().split())) + + +def mylistinput(n): +    return [list(myinput()) for _ in range(n)] -n, m = myinput() -ab = [list(myinput()) for _ in range(m)] -v = list(range(1, n + 1)) -p = list(permutations(v)) -# print(p) -count = 0 -for s in p: -    # print(s) -    if s[0] != 1: -        pass +def mysort(data, col, reverse_flag): +    data.sort(key=lambda x: x[col], reverse=reverse_flag) +    return data + + +def mymax(data): +    M = -1 * float("inf") +    for i in range(len(data)): +        m = max(data[i]) +        M = max(M, m) +    return M + + +def mymin(data): +    m = float("inf") +    for i in range(len(data)): +        M = min(data[i]) +        m = min(m, M) +    return m + + +def mycount(ls, x): +    # lsはソート済みであること +    l = bisect_left(ls, x) +    r = bisect_right(ls, x) +    return r - l + + +def myoutput(ls, space=True): +    if space: +        if len(ls) == 0: +            print(" ") +        elif type(ls[0]) == str: +            print((" ".join(ls))) +        elif type(ls[0]) == int: +            print((" ".join(map(str, ls)))) +        else: +            print("Output Error") -        flag = True -        for j in range(n - 1): -            v_tmp = s[j] -            v_next = s[j + 1] -            c = [v_tmp, v_next] -            d = [v_next, v_tmp] -            if (c in ab) or (d in ab): -                pass +        if len(ls) == 0: +            print("") +        elif type(ls[0]) == str: +            print(("".join(ls))) +        elif type(ls[0]) == int: +            print(("".join(map(str, ls)))) +        else: +            print("Output Error") + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def RI(): +    return list(map(int, input().split())) + + +def CI(n): +    return [int(eval(input())) for _ in range(n)] + + +def LI(n): +    return [list(map(int, input().split())) for _ in range(n)] + + +def S(): +    return eval(input()) + + +def MS(): +    return input().split() + + +def RS(): +    return list(input().split()) + + +def CS(n): +    return [eval(input()) for _ in range(n)] + + +def LS(n): +    return [list(input().split()) for _ in range(n)] + + +n, m = RI() +ab = LI(m) +g = [[] for _ in range(n)] +for i in range(m): +    a = ab[i][0] - 1 +    b = ab[i][1] - 1 +    g[a].append(b) +    g[b].append(a) +# print(g) +l = list(range(1, n)) +ls = list(permutations(l)) +# print(ls) +ans = 0 +for i in range(len(ls)): +    flag = True +    v = [0] * n +    p = [0] + list(ls[i]) +    # print(p) +    for j in range(len(p) - 1): +        if v[p[j]] != 0: +            flag = False +        else: +            if p[j + 1] in g[p[j]]: +                v[p[j]] = 1 -        if flag: -            count += 1 -        else: -            pass -    # print(count) -print(count) +    if flag: +        ans += 1 +    else: +        pass +print(ans)