Can You Distribute ?

3

1 votes
Problem

Ricky has N different balls and John has R different bags. Their teacher Ms.Samara wants them to distribute these N balls into R bags such that each bag gets at least one ball. Can you find the number of ways of doing so ?


Input:

The one and only line of input contains two numbers separated by a single space, which are N and R respectively.

Output:

The corresponding answer modulo 10000007 in a single line and if no answer exist then print "-1".


Constraints:

1 <= N <= 100

1 <= R <= 100

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Let the 2 groups be A and B respectively. Case 1: A gets 1 object and B gets 3 Case 2: A gets 2 objects and B gets 2 Case 3: A gets 3 objects and B gets 1

Editor Image

?