#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

const ll MOD = 1e9+7;
ll dp[101][8];

int main(){
    ll h, w, k; cin >> h >> w >> k;
    
    if(w == 1){ cout << 1 << endl; return 0; }
    
    dp[0][0] = 1;
    rep(i,h){
        rep(j,1<<(w-1)){
            vector<bool> count(w-1,false);
            rep(k,w-1) if(j & 1<<k) count[k] = true;
            bool check = false;
            rep(k,w-2) if(count[k] && count[k+1]) check = true;
            if(check) continue;

            rep(k,w-1){
                if(count[k]){
                    dp[i+1][k+1] += dp[i][k];
                    dp[i+1][k+1] %= MOD;
                    dp[i+1][k] += dp[i][k+1];
                    dp[i+1][k] %= MOD;
                }
                else if(k == 0){
                    dp[i+1][0] += dp[i][0];
                    dp[i+1][0] %= MOD;
                }
                else if(!count[k-1]){
                    dp[i+1][k] += dp[i][k];
                    dp[i+1][k] %= MOD;
                }
                if(!count[k] && k == w-2){
                    dp[i+1][w-1] += dp[i][w-1];
                    dp[i+1][w-1] %= MOD;
                }
            }
        }
    }

    cout << dp[h][k-1] << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1005,M=1e9+7;
int n,A,B,C,D,fac[N],inv[N],dp[N][N];
int ksm(int x,int y){
	int ans=1;
	for (;y;y>>=1,x=x*x%M)
		if (y&1)(ans*=x)%=M;
	return ans;	
}
signed main(){
	scanf("%lld%lld%lld%lld%lld",&n,&A,&B,&C,&D);
	dp[0][A-1]=1;
	fac[0]=inv[0]=1;
	for (int i=1;i<=n;i++)fac[i]=fac[i-1]*i%M,inv[i]=ksm(fac[i],M-2);
	for (int i=0;i<=n;i++)
		for (int j=A;j<=B;j++){
			dp[i][j]=dp[i][j-1];
			for (int k=C,p=ksm(inv[j],C);k<=D;k++,(p*=inv[j])%=M){
				if (i-j*k<0)break;
				(dp[i][j]+=dp[i-j*k][j-1]*p%M*inv[k])%=M;
			}
		}
	printf("%lld\n",dp[n][B]*fac[n]%M);
} 
