#include<bits/stdc++.h>
using namespace std;
int  n,m,x,y,f[5000000],a[3000][3000],ans,l;
bool d[500000];
int min(int a,int b) {
	if (a<b) return a;
	else return b;
}
int find(int t) {
	if (f[t]==t) return t;
	f[t]=find(f[t]);
	return f[t];
}
void build(int x,int y) {
	int xx,yy;
	xx=find(x);
	yy=find(y);
	f[yy]=f[xx];
}
bool sou() {
	int w;
	w=-1;
	l=0;
	for (int i=1; i<=n; i++)
		if (d[i]==true) {
			if (w==-1)  w=find(i);
			else if (find(i)!=w) return false;
		}
	for (int i=1;i<=n;i++)
	  if (d[i]==true)
	  l+=a[w][i];
	return true;
}
void bfs(int t) {
	if (t>n) return;
	bfs(t+1);
	d[t]=true;
	if (sou()==true) {
     ans=(ans+m-l+1)%1000000007;
	}
	bfs(t+1);
}
int main() {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for (int i=1; i<=n; i++)  f[i]=i;
	for (int i=1; i<=m; i++) {
		cin>>x>>y;
		a[x][y]++;
		a[y][x]++;
		build(x,y);
	}
	for (int i=1; i<=n; i++)
		for (int j=1; j<=n; j++) {
			if (i!=j)
				if (a[i][j]!=0)
					for (int k=1; k<=n; k++) {
						if (k!=i&&k!=j) {

							if (a[i][k]!=0) {
								a[k][i]=min(a[i][j]+1,a[i][k]);
								a[i][k]=min(a[i][j]+1,a[i][k]);
							} else {
								a[k][i]=a[i][j]+1;
								a[i][k]=a[i][j]+1;
							}
						}
					}
		}
	bfs(1);
	cout<<ans;
	return 0;
}
