import sys f=lambda n,k:(n and k and n>=k and k*(f(n-1,k-1)+f(n-1,k)))or(n+k==0 and 1)or 0 for l in sys.stdin:print f(*(map(int,l.split())))