N = int(input()) M = int(input()) from operator import mul from functools import reduce def cmb(n,r,mod): r = min(n-r,r) if r == 0: return 1 over = reduce(mul, range(n, n - r, -1)) under = reduce(mul, range(1,r + 1)) return (over // under)%mod a = cmb(N, M,10**8) s = str(a) print('0'*(8-len(s))+s)