import java.util.*; class Main { static final long MOD = 1000000007; static final int N = 5000; static long[] fact; static void initialize() { fact = new long[N]; fact[0] = 1; for (int i = 1; i < N; ++i) { fact[i] = (i * fact[i - 1]) % MOD; } } static long powerMod(long x, long exponent) { long prod = 1; for (int i = 63; i >= 0; --i) { prod = (prod * prod) % MOD; if ((exponent & 1L << i) != 0) { prod = (prod * x) % MOD; } } return prod; } static long comb(int x, int y) { if (x < 0) { return 0; } if (y < 0 || y > x) { return 0; } long r= (fact[x] * powerMod((fact[x - y] * fact[y]) % MOD, MOD - 2)) % MOD; return r; } static long f(int x, int y) { if (x == 0) { return y == 0 ? 1 : 0; } return comb(x - 1, y - 1); } static long sub(int n, int k, int t) { long total = 0; if (n - k >= k - t + 1) { total += f(n - k, k - t + 1); } if (n - k >= k - t) { total += 2 * f(n - k, k - t); } if (n - k >= k - t - 1) { total += f(n - k, k - t - 1); } total %= MOD; return (comb(k - t, t) * total) % MOD; } static long helper(int t, int u, int r, int g, int b) { long total = 0; for (int x = 0; x <= t; ++x) { if (r < x || g < x) { continue; } for (int y = 0; y <= t - x; ++y) { int z = t - x - y; int rRest = r - x - z; int gRest = g - x - y; int bRest = b - y - z; if (rRest < 0 || gRest < 0 || bRest < 0) { continue; } long divisor = (fact[rRest] * fact[gRest]) % MOD; divisor = (divisor * fact[bRest]) % MOD; divisor = (divisor * fact[x]) % MOD; divisor = (divisor * fact[y]) % MOD; divisor = (divisor * fact[z]) % MOD; long tmp = powerMod(divisor, MOD - 2); total = (total + tmp) % MOD; } } long multiplier = (fact[u] * fact[t]) % MOD; total = (total * multiplier) % MOD; return (total * powerMod(2, t)) % MOD; } static long calculate(int n, int r, int g, int b) { initialize(); int count = r + g + b; if (count > n) { return 0; } long total = 0; for (int t = 0; t <= count / 2; ++t) { long res = sub(n, count, t); if (res == 0) { continue; } long dat = helper(t, count - 2 * t, r, g, b); long mult = (res * dat) % MOD; total += mult; total %= MOD; } return total; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int r = scan.nextInt(); int g = scan.nextInt(); int b = scan.nextInt(); System.out.println(calculate(n, r, g, b)); } }