//Can Xu Tao AK NOIP?
#include<bits/stdc++.h>
using namespace std;
unsigned long long c=1;
int readd()
{
	int f=1,x=0;
	char str=getchar();
	while(str<'0'||str>'9')
	{
		if(str=='-')
		 f=-1;
		str=getchar();
	}
	while(str>='0'&&str<='9')
	 x=x*10+str-'0',str=getchar();
	return x*f;
}
unsigned long long A(int u,int v)
{
	if(u==v)
	 return 1;
	int i;
	unsigned long long X=0;
	for(i=v-1;i>=u;i++)
	 X=(X+A(u,v-1))%1000000007;
	return X%1000000007;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int n,m,i,u,v;
	n=readd(),m=readd();
	for(i=1;i<=m;i++)
	 u=readd(),v=readd();
	for(i=1;i<=m;i++)
	 c=(c+A(i,m))%1000000007;
	cout<<c<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}