{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"You are building a residential area. There are $n$ plots for buildings. You have a budget to build $k$ floors in total. \n\nThe $i_{th}$ plot can have a building with at most $a_i$ floors. You can also decide to skip constructing this building completely (no floors) costing you nothing.\n\nYou have to build all (and exactly) the $k$ floors somehow in the buildings you decide on constructing.\n\nHow many ways can you do it? Two ways are different if a building has different number of floors."}},{"title":"Input","value":{"format":"MD","content":"First line contains two integers $n$ $(1 \\leq n \\leq 100)$ and $k$ $(0 \\leq k \\leq 10^5)$ denoting the number of empty plots and the number of floors you need to build.\n\nThe next line contains $n$ integers with the $i_{th}$ integer $a_i$ $(0 \\leq a_i \\leq k)$ denoting the floor limit of the $i_{th}$ building."}},{"title":"Output","value":{"format":"MD","content":"\n\u003csection\u003e\n\u003cp\u003ePrint the number of ways, modulo \u003cvar\u003e\\(10^9 + 7\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e\n"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 4\n1 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003csection\u003e\n\n\n\u003c/section\u003e\n\n\u003csection\u003e\n\n\n\u003cp\u003eThe possible constructions:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cvar\u003e\\((0, 1, 3)\\)\u003c/var\u003e\u003c/li\u003e\n\u003cli\u003e\u003cvar\u003e\\((0, 2, 2)\\)\u003c/var\u003e\u003c/li\u003e\n\u003cli\u003e\u003cvar\u003e\\((1, 0, 3)\\)\u003c/var\u003e\u003c/li\u003e\n\u003cli\u003e\u003cvar\u003e\\((1, 1, 2)\\)\u003c/var\u003e\u003c/li\u003e\n\u003cli\u003e\u003cvar\u003e\\((1, 2, 1)\\)\u003c/var\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/section\u003e\n"}},{"title":"Sample 2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 10\n9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003csection\u003e\n\n\u003c/section\u003e\n"}},{"title":"Sample 3","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 0\n0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003csection\u003e\n\n\n\u003c/section\u003e\n\n"}},{"title":"Sample 4","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4 100000\n100000 100000 100000 100000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e665683269\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003csection\u003e\n"}}]}