#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e17+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
//  16:30-
//A 16:36
//B 16:46
//C 16:51
//D 17:15WA
//D 17:17TLE
int n;
vector<pair<int,int>>mada;
vector<vector<int>>taisen;
map<vector<int>,llint>memo;
llint sai(vector<int>win,int kai){
	if(kai>=mada.size()){return 1;}
	if(memo.count(win)){return memo[win];}
	int A=mada[kai].fir,B=mada[kai].sec;
	auto wina=win,winb=win;
	llint ans=0;
	wina[A]++;
	if(wina[A]<=n/2&&taisen[kai][B]-wina[B]<=n/2){ans+=sai(wina,kai+1);}
	winb[mada[kai].sec]++;
	if(winb[B]<=n/2&&taisen[kai][A]-winb[A]<=n/2){ans+=sai(winb,kai+1);}
	memo[win]=ans;
	return ans;
}
int solve(void){
	int i,j,m;cin>>n;
	memo.clear();taisen.clear();mada.clear();
	if(n==0){return 0;}
	cin>>m;
	vector<int>win(n);
	int yata[9][9]={};
	vector<int>tai(n);
	while(m--){
		int a,b;cin>>a>>b;a--;b--;
		yata[a][b]=1;yata[b][a]=1;win[a]++;
		tai[a]++;tai[b]++;
	}
	
	//cerr<<"ans=";
	for(i=0;i<n;i++){
		if(win[i]>n/2){cout<<0<<endl;return 1;}
		for(j=i+1;j<n;j++){
			if(!yata[i][j]){
				mada.pub(mp(i,j));
				tai[i]++;tai[j]++;
				taisen.pub(tai);
			}
		}
	}
	cout<<sai(win,0)<<endl;
	
	return 1;
}
int main(void){
	while(solve()){}
	return 0;
}
