can-you-distribute
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

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

SAMPLE INPUT
4 2

SAMPLE OUTPUT
3

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


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
from math import factorial
n,k=list(map(int,input().split()))
if n>=k:
	f=factorial(n-1)/(factorial(n-k)*factorial(k-1))
	print(f%10000007)
else:
	print("-1")


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
from math import factorial
n,k=list(map(int,input().split()))
if n>=k:
	f=factorial(n-1)/(factorial(n-k)*factorial(k-1))
	print(f%10000007)
else:
	print("-1")


# cook your code here
import os
import math





n,r=list(map(int,input().split()))
if n<r:
	print ("-1")
else:
	n=n-r   
	n=n+r -1
	r=r-1
	print((int(math.factorial(n)/(math.factorial(n-r)*math.factorial(r)))%10000007))
			


def binomial(n,m):
	if (n < m or m < 0):
		return 0
	ans = 1
	ans2 = 1
	for i in range(m):
		ans *= n - i
		ans2 *= i + 1
	return ans / ans2

n,m=list(map(int,input().split()))
t=binomial(n-1,m-1)
if t==0:
	print(-1)
else:
	print(int(t)%10000007)


def C(n,r):
	ret=1;
	r=min(r,n-r)
	for i in range(r):
		ret*=(n-i)
		ret/=(i+1)
	return ret%((10**7)+7)

n,r=list(map(int,input().split()))
if n<r or r-1 < 0 or n-1 < 0: print(-1);
else: print(C(n-1,r-1))


import math

def nCr(n,r):
	f = math.factorial
	return f(n) / f(r) / f(n-r)

if __name__ == '__main__':
	a,r=list(map(int,input().split()))
	if (a-1)>=(r-1) and (a-1)>0 and (r-1)>=0:
	  print((nCr(a-1,r-1))%((10**7)+7))
	else:
	  print(-1)


from math import factorial as f
n,k=list(map(int,input().split()))
if n>=k:
	n-=1
	k-=1
	ans=f(n)/(f(k)*f(n-k))
	print(ans%10000007)
else:
	print(-1)
	


import math
m=10000007
a,b=list(map(int,input().split()))
if b>a:
	print("-1")
else:
	a=a-1
	b=b-1
	x=math.factorial(a)
	y=math.factorial(b)*math.factorial(a-b)
	print((x/y)%m)