{"raw_statement":[{"iden":"problem statement","content":"Given is a sequence $A$ of $N$ numbers. Find the number of ways to separate $A$ into some number of non-empty contiguous subsequence $B_1, B_2, \\ldots, B_k$ so that the following condition is satisfied:\n\n*   For every $i\\ (1 \\leq i \\leq k)$, the sum of elements in $B_i$ is divisible by $i$.\n\nSince the count can be enormous, print it modulo $(10^9+7)$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 3000$\n*   $1 \\leq A_i \\leq 10^{15}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"4\n1 2 3 4"},{"iden":"sample output 1","content":"3\n\nWe have three ways to separate the sequence, as follows:\n\n*   $(1),(2),(3),(4)$\n*   $(1,2,3),(4)$\n*   $(1,2,3,4)$"},{"iden":"sample input 2","content":"5\n8 6 3 3 3"},{"iden":"sample output 2","content":"5"},{"iden":"sample input 3","content":"10\n791754273866483 706434917156797 714489398264550 918142301070506 559125109706263 694445720452148 648739025948445 869006293795825 718343486637033 934236559762733"},{"iden":"sample output 3","content":"15\n\nThe values in input may not fit into a $32$\\-bit integer type."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}