LearnPy Hub
← Arena
AdvancedRating 1500

Ways to Reach a Sum

Count the subsets of the numbers whose sum equals target, mod 1 000 000 007.

Input

n target, then n positive integers.

Output

A count.

Sample 1

Input
5 10
2 3 5 6 8
Output
2

Sample 2

Input
3 3
1 1 1
Output
1
solution.py
Output appears here
Ways to Reach a Sum · Python Arena problem · LearnPy Hub