n, aim = map(int, input().split())
nums = list(map(int, input().split()))
dp = [0] * (aim + 1)
dp[0] = 1
for i in range(n):
for j in range(nums[i],aim + 1):
dp[j] = (dp[j] + dp[j - nums[i]]) % (1e9 + 7)
print(int(dp[-1] % (1e9 + 7)))
n, aim = map(int, input().split())
nums = list(map(int, input().split()))
dp = [0] * (aim + 1)
dp[0] = 1
for i in range(n):
for j in range(nums[i],aim + 1):
dp[j] = (dp[j] + dp[j - nums[i]]) % (1e9 + 7)
print(int(dp[-1] % (1e9 + 7)))