a, b = map(int, input().split()) n, k = map(int, input().split()) mod = 10**9 + 7 a %= mod b %= mod fact = [1] * n inv = [1] * n finv = [1] * n for i in range(2, n): fact[i] = fact[i - 1] * i % mod inv[i] = mod - inv[mod % i] * (mod // i) % mod finv[i] = finv[i - 1] * inv[i] % mod def comb(x, y): if x < 0 or y < 0 or x - y < 0: return 0 return fact[x] * finv[y] % mod * finv[x - y] % mod res = comb(n - 1, k - 1) * a % mod + comb(n - 1, k - 2) * b % mod print(res % mod) ans = pow(a, 2, mod) + pow(b, 2, mod) % mod for i in range(2, n + 1): ans += pow(comb(n - 1, i - 1) * a % mod + comb(n - 1, i - 2) * b % mod, 2, mod) ans %= mod print(ans)