#include using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define mp make_pair #define all(c) (c).begin(),(c).end() #define rall(c) (c).rbegin(),(c).rend() typedef long long ll; typedef pair pii; typedef pair pll; const ll inf=1e9+7; const ll mod=1e9+7; ll depth(ll a){ ll cnt=0; while(a){ cnt++; a/=2; } return cnt; } ll e(ll d){ ll res=1; ll s=d; while(s>0){ s--; res*=2; res%=inf; } return res; } int main(){ ll d,l,r,k;cin>>d>>l>>r>>k; ll ans=1; ll anc=(depth(l)+depth(r)-k)/2; ans*=e(depth(l)-anc-1); ans%=inf; ans*=e(depth(r)-anc-1); ans%=inf; ans*=2; ans%=inf; ll f=0; if(depth(r)==depth(l))f=1; rep(i,d){ k=e(i); if(f&&i==depth(r)-1)k-=2; else if(i==depth(r)-1)k--; else if(i==depth(l)-1)k--; while(k>1){ ans*=k; ans%=inf; k--; } } cout<