Summing Sequence (8 Points)


Problem Statement

You have an array aa of nn non-negative integers. You wish to decrease some (any number) of the integers so that they remain non-negative and the sum of the sequence is equal to kk. In other words, you can form a new sequence bb of length nn such that 0biai0 \leq b_i \leq a_i and xbx=k\sum_{x\in b} x = k.

Determine the number of distinct ways to do this modulo 998244353998244353. We call two ways distinct if the resulting sequences after decreasing some of the integers have a different number at some index.

Input Format

Your first line will contain two integers nn and kk. Your next line will contain nn space-separated integers representing aa.

Output Format

Output a single integer representing the number of ways modulo 998244353998244353.

Constraints

  • 1n,k31041 \leq n, k \leq 3 \cdot 10^4
  • 1ai151 \leq a_i \leq 15

Sample Cases

Input 1
4 3
1 1 1 1
Output 1
4
Explanation 1

The different sequences you can make are [0,1,1,1][0,1,1,1], [1,0,1,1][1,0,1,1], [1,1,0,1][1,1,0,1] and [1,1,1,0][1,1,1,0].

Input 2
3 28
10 10 10
Output 2
6
Explanation 2

There are 3 ways if you decrease one of the 10s to an 8, 3 ways where you decrease 2 of the 10s to 9s.

Input 3
15 33 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Output 3
509689781
Explanation 3

Remember to modulo by 998244353998244353.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.