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() twos = [(1,0)] fives = [(1,0)] base = 10**8 mtwo = 1 mfive = 1 while base%2 == 0: base //= 2 mtwo *= 2 while base%5 == 0: base //= 5 mfive *= 5 # print(mtwo,mfive,mtwo*mfive) for i in range(1,m+1): now = i x,y = twos[-1] while now%2 == 0: now //= 2 y += 1 x = x*now % mtwo twos.append([x,y]) now = i x,y = fives[-1] while now%5 == 0: now //= 5 y += 1 x = x*now % mfive fives.append([x,y]) # print(twos) # print(fives) 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) # print(nn,invnn,nn*invnn%mod) base = base * invnn%mod return base,num base2,num2 = nCrmodP(m,n,mtwo,twos) base5,num5 = nCrmodP(m,n,mfive,fives) # print(base2,num2) # print(base5,num5) 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) # print(ans,_) ans %= 10**8 print("{:08}".format(ans))