from math import lcm k, n = map(int, input().split()) if n == k: print(1) exit() nCk = [[0] * (n + 1) for _ in range(n + 1)] nCk[0][0] = 1 for i in range(1, n + 1): nCk[i][0] = 1 for j in range(1, n + 1): nCk[i][j] = nCk[i - 1][j - 1] + nCk[i - 1][j] ng = [False] * 25 ng[13] = True ng[17] = True ng[19] = True ng[23] = True isprime = [False] * 26 isprime[2] = True isprime[3] = True isprime[5] = True isprime[7] = True isprime[11] = True lc = 1 for i in range(1, n + 1): if ng[i]: continue lc = lcm(lc, i) dp = [[-1] * (lc + 1) for _ in range(n * (n + 1) + n + 1)] def dfs(t, x, tot): if tot == lc: global ans if x == 0: return 1 return 0 if t == 0: return 0 if tot + (lc // t) * x > lc: return 0 if ng[t]: return dfs(t - 1, x, tot) if dp[t * (n + 1) + x][tot] != -1: return dp[t * (n + 1) + x][tot] ret = 0 for j in range(x + 1): ntot = tot + (lc // t) * j if ntot <= lc: ret += dfs(t - 1, x - j, ntot) * nCk[x][j] dp[t * (n + 1) + x][tot] = ret return ret ans = dfs(n, k, 0) print(ans)