Under construction

Still being built. Things may change

Average

Time limit1sMemory limit512 MB

Summary
Count, over all N-tuples of integer marks from 0 to fullmarks, the total number of teachers whose mark equals the tuple's mean, modulo 1000000007.
Level

Medium7 of 10

Topics
Combinatorics, Dynamic programming, Math
Solved
No attempts yet

Problem

NN teachers grade one student's presentation. Each teacher gives one integer from 0 to fullmarks, inclusive. The student's final score is the arithmetic mean of these NN marks.

Every mark is an integer, but the mean can still be a fraction. Sometimes the mean is an integer, and in some of those cases a teacher's mark equals the mean exactly. One teacher whose mark equals the mean is called a matching event.

Consider every combination of marks the teachers can give. If kk teachers gave a mark equal to the mean in one combination, that combination produces kk matching events. Count the total number of matching events over all combinations.

Input

The input holds several test cases, at most 1001 of them.

Each test case is one line with two integers NN and fullmarks, where 2≤N≤602 \le N \le 60 and 1≤fullmarks≤2001 \le \text{fullmarks} \le 200. NN is the number of teachers grading the student, and fullmarks is the largest mark a teacher can give. The smallest mark a teacher can give is always 0.

A line holding two zeros ends the input. Do not process that line.

Output

For each test case, print one line holding MM modulo 10000000071000000007, where MM is the total number of matching events.

Examples3

  1. Example 1

    Input
    4 100
    3 1
    0 0
    
    Expected output
    1373732
    6
    
  2. Example 2

    Input
    2 1
    0 0
    
    Expected output
    4
    
  3. Example 3

    Input
    3 200
    5 7
    2 3
    0 0
    
    Expected output
    60603
    5120
    8