#include <bits/stdc++.h>
using namespace std;
long long int n, m, a, b, c, d;
char in[100], out[100];
long long int dp[120][120];

int main(){
    long long int w, h,i,j;
	for(int I=1;I<=20;I++){
		sprintf(in,"%d.in",I);
	    freopen(in,"w",stdout);
		w = I*5-rand()%I;
		h = I*5-rand()%I;
		a = rand()%w+1;
		b = rand()%h+1;
		c = rand()%w+1;
		d = rand()%h+1;

        printf("%lld %lld\n",w,h);
        printf("%lld %lld %lld %lld\n",a, b, c, d);

		for(i=0;i<120;i++){
            for(j=0;j<120;j++){
                dp[i][j]=0;
            }
		}
		dp[a][b]=1;
        for(j=1;j<=h;j++)
        {
            for(i=1;i<=w;i++)
            {
                if(j%2==0 and i==w) continue;
                if(j%2==0) dp[i][j+1] = (dp[i][j+1]+dp[i][j])%1000000007;
                else dp[i-1][j+1]=(dp[i-1][j+1]+dp[i][j])%1000000007;
                dp[i+1][j] = (dp[i+1][j] + dp[i][j])%1000000007;
                if(j%2==0) dp[i+1][j+1]= (dp[i+1][j+1]+dp[i][j])%1000000007;
                else dp[i][j+1] = (dp[i][j+1]+dp[i][j])%1000000007;
            }
        }

		sprintf(out,"%d.out",I);
	    freopen(out,"w",stdout);

		printf("%lld\n",dp[c][d]);
		if(dp[c][d]==0) I--;
	}
}
