#想定解じゃなさそう import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) INF = 2 ** 63 - 1 def solve(a, s): from collections import Counter n = len(a) dp = Counter() dp[0] = 1 for i in range(n): e = Counter() for j in range(1, 40): now = a[i] ** j if now >= s: break for v, c in dp.items(): e[v + now] += c dp = e return dp n, s = mi() a = li() a.sort() a1 = a[:n // 2] a2 = a[n//2:] dp1 = list(solve(a1, s).items()) dp2 = list(solve(a2, s).items()) dp1.sort() dp2.sort() summ = 0 for v, c in dp2: summ += c now = len(dp2) - 1 ans = 0 for v, c in dp1: while now >= 0: if dp2[now][0] + v <= s: break summ -= dp2[now][1] now -= 1 ans += c * summ print(ans)