unittest
{
	assert( [ "3 3", "1 2", "1 3", "2 3" ].parse.expand.solve == 2 );
	assert( [ "7 7", "1 3", "2 7", "3 4", "4 5", "4 6", "5 6", "6 7" ].parse.expand.solve == 1 );
	
	assert( [ "4 4", "1 2", "1 3", "2 3", "3 4" ].parse.expand.solve == 1 );		// 追加ケース
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	auto abs = new long[][]( nm[ 1 ], 2 );
	foreach( ref ab; abs )
	{
		input.popFront;
		ab = input.front.split.to!( long[] );
	}
	return tuple( nm[ 0 ], abs );
}

auto solve( long n, long[][] abs )
{
	return solve2( n, abs, 1L, new long[]( n ) );
}

long solve2( long n, long[][] abs, long p, long[] ps )
{
	auto ans = 0L;
	
	// 今の頂点の通った回数を加算
	ps[ p - 1 ]++;
	
	// 次の辺を検索
	foreach( i, ab; abs )
	{
		if( ab[ 0 ] == p ) ans += solve2( n, abs[ 0 .. i ] ~ abs[ i + 1 .. $ ], ab[ 1 ], ps.dup );
		if( ab[ 1 ] == p ) ans += solve2( n, abs[ 0 .. i ] ~ abs[ i + 1 .. $ ], ab[ 0 ], ps.dup );
	}
	
	// 全ての頂点を一回だけ通っていれば答えに追加
	if( ps.find!( ( a ) => a != 1 ).empty ) ans++;
	
	return ans;
}
