#include<bits/stdc++.h>
using namespace std;
const int p=1e9+7;
int n,m;
int j[500010];
int ans;
//int head[2000010],ver[2000010],nxt[2000010],tot;
void add(int x,int y)
{
	ver[++tot]=y;
	nxt[tot]=head[x];
	head[x]=tot;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int x,y;
	scanf("%d%d",&n,&m);
	if(m==n-1)
	{
		for(int i=1;i<=m;i++)
		{
			scanf("%d%d",&x,&y);
		}
		ans=n*2;
		j[0]=1;
		for(int i=1;i<=n;i++)
		{
			j[i]=j[i-1]*i%p;
		}
		for(int i=2;i<=n;i++)
		{
			ans=(ans+j[n]/j[i]/j[n-i])%p;
			cout<<ans<<endl;
		}
		printf("%d",ans);
		return 0;
	}
	return 0;
}
