using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        var NM = ConsoleUtil.IntArrayReadLine();
        var N = NM[0];
        var M = NM[1];
        var pathList = Enumerable.Repeat(0, M)
            .Select(n => ConsoleUtil.IntArrayReadLine())
            .Select(arr => new { a = arr[0], b = arr[1] })
            .ToArray();

        var nodes = Enumerable.Range(1, N).ToArray();

        Func<int, int, bool> isOKPath = (int node1, int node2) =>
        {
            return pathList.Any(p => (p.a == node1 && p.b == node2) || (p.a == node2 && p.b == node1));
        };

        int ans = 0;

        foreach(var order in GetOrder(Enumerable.Range(2, nodes.Length - 1)))
        {
            var currentNode = 1;
            bool isOK = true;
            foreach(var x in order)
            {
                if(isOKPath(x, currentNode))
                {
                    currentNode = x;
                    continue;
                }
                else
                {
                    isOK = false;
                    break;
                }
            }

            if (isOK)
                ans++;
        }

        Console.WriteLine(ans);
    }

    static IEnumerable<IEnumerable<int>> GetOrder(IEnumerable<int> source)
    {
        int count = source.Count();

        if (count == 1)
        {
            yield return Single(source.ElementAt(0));
        }

        for(int i = 0; i < count; i++)
        {
            var remain = source.Take(i).Concat(source.Skip(i+1));

            foreach (var order in GetOrder(remain))
            {
                yield return Single(source.ElementAt(i)).Concat(order);
            }
        }
    }

    static IEnumerable<int> Single(int x)
    {
        yield return x;
    }
}

static class MathUtil
{
    static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}

static class ConsoleUtil
{
    public static string[] StrArrayReadLine(char sepalator)
    {
        string str = Console.ReadLine();
        return str.Split(sepalator).ToArray();
    }
    public static string[] StrArrayReadLine()
    {
        string str = Console.ReadLine();
        if (str.Contains(','))
        {
            return str.Split(',').ToArray();
        }
        {
            return str.Split(' ').ToArray();
        }
    }
    public static int[] IntArrayReadLine()
    {
        return StrArrayReadLine().Select(s => int.Parse(s)).ToArray();
    }
    public static int[] IntArrayReadLine(char sepalator)
    {
        return StrArrayReadLine(sepalator).Select(s => int.Parse(s)).ToArray();
    }
    public static int IntReadLine() => int.Parse(Console.ReadLine());
    public static long LongReadLine() => long.Parse(Console.ReadLine());
}

Measured memory_bytes: 17628