def extgcd(a, b): # ax + by = gcd(a,b) # return gcd(a,b), x, y if a == 0: return b, 0, 1 else: g, x, y = extgcd(b % a, a) return g, y - (b // a) * x, x def chineseRem(b1, m1, b2, m2): # x ≡ b1 (mod m1) ∧ x ≡ b2 (mod m2) <=> x ≡ r (mod m) # となる(r. m)を返す # 解無しのとき(0, -1) d, p, q = extgcd(m1, m2) if (b2 - b1) % d != 0: return 0, -1 m = m1 * (m2 // d) # m = lcm(m1, m2) tmp = (b2-b1) // d * p % (m2 // d) r = (b1 + m1 * tmp) % m return r, m m = int(input()) n = int(input()) if m < n: print("{:08}".format(0)) exit() if m == n: print("{:08}".format(1)) exit() twos = [[1,0] for i in range(m+2)] fives = [[1,0] for i in range(m+2)] mtwo = 2**8 mfive = 5**8 for i in range(1,m+1): now = i x,y = twos[i-1] while now%2 == 0: now //= 2 y += 1 x = x*now % mtwo twos[i] = [x,y] now = i x,y = fives[i-1] while now%5 == 0: now //= 5 y += 1 x = x*now % mfive fives[i] = [x,y] ans = 1 def nCrmodP(n,r,mod,nums): num = nums[n][1] - nums[r][1] - nums[n-r][1] base = nums[n][0] nn = nums[r][0]*nums[n-r][0]%mod _,invnn,_ = extgcd(nn,mod) base = base * invnn%mod return base,num base2,num2 = nCrmodP(m,n,mtwo,twos) base5,num5 = nCrmodP(m,n,mfive,fives) if num2 >= 8: base2 = 0 else: base2 *= pow(2,num2) if num5 >= 8: base5 = 0 else: base5 *= pow(5,num5) ans,_ = chineseRem(base2,mtwo,base5,mfive) ans %= 10**8 print("{:08}".format(ans))