d, l, r, k = map(int, input().split()) # N = int(input()) # C = list(map(int,input().split())) N = (1 << d) MOD = 10 ** 9 + 7 fact = [1] * (N + 1) rfact = [1] * (N + 1) r0 = 1 for i in range(1, N + 1): fact[i] = r0 = r0 * i % MOD rfact[N] = r0 = pow(fact[N], -1, MOD) for i in range(N, 0, -1): rfact[i - 1] = r0 = r0 * i % MOD def comb(x,y): return fact[x] * rfact[x-y] * rfact[y] dl = l.bit_length() - 1 dr = r.bit_length() - 1 if dl > dr: dl, dr = dr, dl if k < abs(dr - dl): print("No") exit() if k > abs(dl + dr): print("No") exit() if (dl + dr - k) % 2 == 1: print("No") exit() dm = (dl + dr - k) // 2 ans = 1 for i in range(d): ans *= fact[1 << i] ans %= MOD if dl != dr: ans *= pow(1 << dl, -1, MOD) ans %= MOD ans *= pow(1 << dr, -1, MOD) ans %= MOD ans *= (1 << dm) ans %= MOD ans *= (1 << (dr - dm)) ans %= MOD ans *= (1 << (dl - dm)) ans %= MOD print(ans) else: a = 1 << dl ans *= pow(a, -1, MOD) ans %= MOD ans *= pow(a-1, -1, MOD) ans %= MOD ans *= (1 << dm) ans %= MOD b = 1<< (dl - dm - 1) ans *= 2 * b ** 2 ans %= MOD print(ans)