//#pragma GCC target("avx2")
//#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>

#define IOS ios::sync_with_stdio(false);cin.tie(nullptr)
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define lc(x) ((x)<<1)
#define rc(x) (((x)<<1)|1)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double ld;

const ll MOD=1e9+7;
const ll LINF=1e18;
const int INF=0x3f3f3f3f;
const int MAXE=5000050;
const int MAXN=2000050;
const int bk_sz=3420;
mt19937 rnd(114514);

ll fac[MAXN],inv[MAXN];
ll mpow(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1){
            ans*=a;
            ans%=MOD;
        }
        a*=a;
        a%=MOD;
        n>>=1;
    }
    return ans;
}
void prework(int n){
    fac[1]=1;
    fac[0]=1;
    for(ll i=1;i<=n;i++){
        fac[i]=fac[i-1]*i;
        fac[i]%=MOD;
    }
    inv[0]=1;
    inv[n]=mpow(fac[n],MOD-2);
    for(ll i=n-1;i;i--){
        inv[i]=inv[i+1]*(i+1)%MOD;
    }
}
ll getC(int n,int m){
    if(n<m||n<0||m<0)return 0ll;
    return fac[n]*inv[m]%MOD*inv[n-m]%MOD;
}
void mainwork(int T){
    ll n,m,k;
    scanf("%lld%lld%lld",&n,&m,&k);
    prework(n+m);
    if(m<=n-k-1){
        puts("0");
        return;
    }
    ll ans=getC(n+m,m)-getC(n+m,m+k+1);
    ans=(ans+MOD)%MOD;
    printf("%lld\n",ans);
}
signed main(){
    //IOS;
#ifndef ONLINE_JUDGE
    freopen("Ranulx.in","r",stdin);
    freopen("Ranulx.out","w",stdout);
#endif
    int t=1;
    //scanf("%d",&t);
    for(int i=1;i<=t;i++){
        mainwork(i);
    }
}
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <functional>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,n) for (ll i = 0; i < (ll)(n); i++)
#define REP(i,n) for (ll i = 1; i <= (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define fcout cout<<fixed<<setprecision(15)
#define PI 3.1415926s535897932384626433832795028841971693993751058209749445923078160628620899
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

ll mod(ll N, ll A) {
	return (N + INF) % A;
}

ll modpow(ll N, ll P, ll M) {
	if (P == 0) return 1;
	if (P % 2 == 0) return modpow(N, P / 2, M) * modpow(N, P / 2 , M) % M;
	return N * modpow(N, P - 1, M) % M;
}

bool isPrime(ll N) {
	ll T = sqrt(N);
	REP(i, T) {
		if (N % i == 0) return false;
	}
	return true;
}

ll GCD(ll A, ll B) {
	if (A % B == 0) return B;
	return GCD(B, A % B);
}

ll LCM(ll A, ll B) {
	return A / GCD(A, B) * B;
}

ll Digit(ll N) {
	string S = to_string(N);
	return S.size();
}

ll getSumDigit(ll N) {
	string S = to_string(N);
	ll A = 0;
	rep(i, S.size()) A += S[i] - '0';
	return A;
}

ll N, C, a[200010];

int main() {
	cin >> N;
	ll P = modpow(2, N, MOD);
	ll M1 = 0;
	rep(i, P) {
		cin >> a[i];
		M1 = max(a[i], M1);
	}
	ll K;
	rep(i, P) if (M1 == a[i]) K = i;
	if (0 <= K && K <= P / 2 - 1) {
		ll M2 = 0;
		for (ll i = P / 2; i < P; i++) M2 = max(a[i], M2);
		for (ll i = P / 2; i < P; i++) if (M2 == a[i]) cout << i + 1 << endl;
	}
	else {
		ll M2 = 0;
		rep(i, P / 2) M2 = max(a[i], M2);
		rep(i, P / 2) if (M2 == a[i]) cout << i + 1 << endl;
	}
	return 0;
}
