#include <iostream>
#include <set>
#include <glob.h>
#include <vector>
#include <unordered_set>
using namespace std;
#define N 16
//int total;
int dfs(int n,int i,int a[N][N],vector<int> st,int &total,vector<set<int>> &v){
if(i>n){st.pop_back();return total;}
set<int> tmp(st.begin(),st.end());
if(st.size()==5 && (count(v.begin(), v.end(), tmp)==0)){
total++;
v.push_back(tmp);
return total;
}
else if(st.size()==5){st={};return total;}
for(int j=1;j<=n;j++){
if(a[i][j]==1 && count(st.begin(), st.end(), j)==0){
st.push_back(j);
dfs(n,j,a,st,total,v);
//erase j所在的位置上
st.pop_back();
}
}
return total;
}
int main(){
int n,m;
cin>>n>>m;
int x,y;
int array[N][N]={0