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 from collections import Counter n, s = mi() a = li() 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 ans = 0 for v, c in dp.items(): if v <= s: ans += c print(ans)