import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np MOD = 10 ** 9 + 7 N, R, G, B = map(int, read().split()) def cumprod(A, MOD=MOD): L = len(A) Lsq = int(L**.5 + 1) A = np.resize(A, Lsq**2).reshape(Lsq, Lsq) for n in range(1, Lsq): A[:, n] *= A[:, n - 1] A[:, n] %= MOD for n in range(1, Lsq): A[n] *= A[n - 1, -1] A[n] %= MOD return A.ravel()[:L] def make_fact(U, MOD=MOD): x = np.arange(U, dtype=np.int64) x[0] = 1 fact = cumprod(x, MOD) x = np.arange(U, 0, -1, dtype=np.int64) x[0] = pow(int(fact[-1]), MOD - 2, MOD) fact_inv = cumprod(x, MOD)[::-1] fact.flags.writeable = False fact_inv.flags.writeable = False return fact, fact_inv fact, fact_inv = make_fact(10 ** 4) answer = 0 for N2 in range(N + 1): N1 = R + G + B - 2 * N2 if N1 < 0: break tile = N1 + N2 space = N - (R + G + B) space -= (tile - 1) if space < 0: continue coef = fact[N1 + N2] * fact_inv[N1] % MOD * fact_inv[N2] % MOD coef *= fact[space + tile] * fact_inv[space] % MOD * fact_inv[tile] % MOD coef %= MOD lo = max(0, N2 - R) hi = min(N2, B, G, N1 + N2 - R) if lo > hi: continue x = fact[N2] * fact_inv[lo: hi + 1] % MOD * fact_inv[N2 - hi: N2 - lo + 1][::-1] % MOD x = x * pow(2, N2, MOD) % MOD x *= fact[N1] * fact_inv[R - N2 + lo: R - N2 + hi + 1] % MOD * fact_inv[N1 + N2 - R - hi: N1 + N2 - R - lo + 1][::-1] % MOD x %= MOD x *= fact[B + G - 2 * hi: B + G - 2 * lo + 2:2][::-1] * fact_inv[B - hi: B - lo + 1][::-1] % MOD * fact_inv[G - hi: G - lo + 1][::-1] % MOD x %= MOD answer += x.sum() % MOD * coef % MOD print(answer % MOD)