program cojs1270;
const
mm=1000007;
var
t,i,j,k,n,m:longint;
a:array[0..105]of longint;
f:array[0..105,0..105]of longint;
begin
assign(input,'flower.in');reset(input);
assign(output,'flower.out');rewrite(output);
readln(n,m);
for i:=1 to n do
read(a[i]);
for i:=0 to a[1] do
f[1,i]:=1;
for i:=2 to n do
for j:=0 to m do
for k:=0 to a[i] do
if j>=k then f[i,j]:=(f[i,j]+f[i-1,j-k]) mod mm else break;
writeln(f[n,m] mod mm);
close(input);close(output);
end.