#GYM104758C. Counting Decorations

Counting Decorations

本题没有可用的提交语言。

Description

You are tasked with decorating a wall that consists of $N$ levels. The decoration should take the shape of a triangle, where each level $i$ of the triangle contains $i$ stickers of a certain color.

There are three available colors for the stickers: Red (R), Green (G), and Blue (B). You have a limited supply of stickers for each color: $R_i$ Red stickers, $G_i$ Green stickers, and $B_i$ Blue stickers. A well-decorated wall is defined as follows:

In each level, all stickers must be of the same color. If more than one color is used on a level, each color should appear the same number of times on that level. Your task is to calculate the number of different ways you can decorate the wall while adhering to these well-decorated criteria.

The first line contains an integer $N$ $(1 \leq N \leq 20)$, representing the number of levels on the wall.

The second line contains three integers $R_i$, $G_i$, and $B_i$ $(0 \leq R_i, G_i, B_i \leq 100)$, representing the number of Red, Green, and Blue stickers available, respectively.

A single integer, the number of different ways to decorate the wall while satisfying the well-decorated criteria. Since the answer may be large, output the result modulo $10^9 + 7$.

Input

The first line contains an integer $N$ $(1 \leq N \leq 20)$, representing the number of levels on the wall.

The second line contains three integers $R_i$, $G_i$, and $B_i$ $(0 \leq R_i, G_i, B_i \leq 100)$, representing the number of Red, Green, and Blue stickers available, respectively.

Output

A single integer, the number of different ways to decorate the wall while satisfying the well-decorated criteria. Since the answer may be large, output the result modulo $10^9 + 7$.

3 1 2 3
21