{"problem":{"name":"Subsequence and Prefix Sum","description":{"content":"You are given an integer sequence $A=(A_1,A_2,\\cdots,A_N)$ of length $N$. You will perform the following operation exactly once: *   Choose a non-empty subsequence of $A$ (not necessarily contiguous)","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc180_c"},"statements":[{"statement_type":"Markdown","content":"You are given an integer sequence $A=(A_1,A_2,\\cdots,A_N)$ of length $N$.\nYou will perform the following operation exactly once:\n\n*   Choose a non-empty subsequence of $A$ (not necessarily contiguous) and replace it with its cumulative sums. More precisely, first choose a sequence of indices $(i_1,i_2,\\cdots,i_k)$ such that $1 \\leq i_1 < i_2 < \\cdots < i_k \\leq N$. The length of the sequence $k$ ($1 \\leq k \\leq N$) can be chosen freely. Then, for each $j$ ($1 \\leq j \\leq k$), replace the value of $A_{i_j}$ with $\\sum_{1 \\leq x \\leq j} A_{i_x}$. This replacement is done simultaneously for all chosen indices.\n\nFind, modulo $10^9+7$, the number of possible sequences $A$ after the operation.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $-10 \\leq A_i \\leq 10$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc180_c","tags":[],"sample_group":[["3\n1 1 2","4\n\nThe possible sequences $A$ after the operation are as follows:\n\n*   $A=(1,1,2)$: This can be achieved with $k=1$ and $(i_1)=(1)$.\n*   $A=(1,2,2)$: This can be achieved with $k=2$ and $(i_1,i_2)=(1,2)$.\n*   $A=(1,1,3)$: This can be achieved with $k=2$ and $(i_1,i_2)=(1,3)$.\n*   $A=(1,2,4)$: This can be achieved with $k=3$ and $(i_1,i_2,i_3)=(1,2,3)$."],["4\n1 -1 1 -1","8"],["5\n0 0 0 0 0","1"],["40\n2 -2 1 3 -3 -1 -2 -3 0 -1 -2 0 -3 0 0 2 0 -1 2 -2 -2 -1 3 -2 -2 -2 2 3 2 -3 0 -2 2 1 3 0 -1 0 -2 -3","420429545"]],"created_at":"2026-03-03 11:01:14"}}