Algorithm for Even Fitting
Provided the $N_i$ are all positive, this is pretty much exactly the problem of "how many ways can I make value $Y$ out of coins with values $N_i$ (assuming no restriction on the number of coins)?"

That problem has a very easy recursive solution that breaks into two cases at each step:


Include a "coin" of value $N_i$ and recurse.
Assume you have used $N_i$ as many times as you are willing and recurse using only values $N_j$ for $j &gt; i$.