#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T b){if(a < b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}

static const int dx[8] = { -1,  0, 1, 0,  1, -1,  1, -1};
static const int dy[8] = {0,  1, 0,  -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
//const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;

int N,M;
int maxd;
int ans;
int G[10][10];
vector<int> st;
vector<int> rest;
vector<pii> match;


bool get_input(){
    scanf("%d",&N);
    if(N == 0) return false;
    MEM(G,0);
    scanf("%d",&M);
    st.clear();
    rest.clear();
    match.clear();
    _for(i,0,N){
        rest.PB(N-1);
        st.PB(0);
    }

    _for(i,0,M){
        int x,y;
        scanf("%d %d",&x,&y);
        x--;y--;
        G[x][y] = (G[y][x] = 1);
        rest[x]--;rest[y]--;
        st[x]++;st[y]--;
    }
    _for(i,0,N){
        _for(j,i+1,N){
            if(!G[i][j]){
                match.PB(MP(i,j));
            }
        }
    }
    maxd = match.size();
    ans = 0;

    return true;
}

bool ok(int a){
    int k = abs(st[a]);
    if(rest[a] < k) return false;
    return true;
}

bool can(){
    _for(i,0,N){ if(st[i]) return false;}
    return true;

}

void searching(int d){
    //cout << rest <<endl;
    //cout << st << endl;
    if(d == maxd){
        if(can())++ans;
        return;
    }

    pii m = match[d];
    int a = m.fst;
    int b = m.scd;
    rest[a]--;rest[b]--;
    st[a]++;st[b]--;
    if(ok(a) && ok(b)){
        searching(d+1);
    }

    st[a]-=2;st[b]+=2;
    if(ok(a) && ok(b)){
        searching(d+1);
    }
    rest[a]++; rest[b]++;
    st[a]++;st[b]--;
}


int main()
{
    //freopen("out.txt","w",stdout);
    while(get_input()){
        searching(0);
        cout << ans << endl;


    }
    return 0;
}

