Determine in how many ways it is possible to obtain a given sum of grades with a specified number of subjects, where the allowed grades are , , and . Two ways are considered different if there exists at least one subject with a different grade.
Calculate the answer modulo .
The input consists of two integers and (1 \le n \le 100, m \le 1000). Here, is the number of subjects, and is the sum of grades.
Output a single integer — the answer to the problem.
Example 1