{"raw_statement":[{"iden":"problem statement","content":"There are $N$ buildings under construction arranged in a row, numbered $1, 2, \\ldots, N$ from left to right.\nGiven is an integer sequence $X$ of length $N$. The height of Building $i$, $H_i$, can be one of the integers between $1$ and $X_i$ (inclusive).\nFor each $i$ such that $1 \\leq i \\leq N$, let us define $P_i$ as follows:\n\n*   If there is an integer $j (1 \\leq j < i)$ such that $H_j > H_i$, $P_i$ is the maximum such $j$. Otherwise, $P_i$ is $-1$.\n\nConsidering all possible combinations of the buildings' heights, find the number of integer sequences that $P$ can be, modulo $1000000007$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   $1 \\leq X_i \\leq 10^5$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$X_1$ $X_2$ $\\cdots$ $X_N$"},{"iden":"sample input 1","content":"3\n3 2 1"},{"iden":"sample output 1","content":"4\n\nWe have six candidates for $H$, as follows:\n\n*   $H = (1, 1, 1)$, for which $P$ is $(-1, -1, -1)$;\n*   $H = (1, 2, 1)$, for which $P$ is $(-1, -1, 2)$;\n*   $H = (2, 1, 1)$, for which $P$ is $(-1, 1, 1)$;\n*   $H = (2, 2, 1)$, for which $P$ is $(-1, -1, 2)$;\n*   $H = (3, 1, 1)$, for which $P$ is $(-1, 1, 1)$;\n*   $H = (3, 2, 1)$, for which $P$ is $(-1, 1, 2)$.\n\nThus, there are four integer sequences that $P$ can be: $(-1, -1, -1), (-1, -1, 2), (-1, 1, 1)$, and $(-1, 1, 2)$."},{"iden":"sample input 2","content":"3\n1 1 2"},{"iden":"sample output 2","content":"1\n\nWe have two candidates for $H$, as follows:\n\n*   $H = (1, 1, 1)$, for which $P$ is $(-1, -1, -1)$;\n*   $H = (1, 1, 2)$, for which $P$ is $(-1, -1, -1)$.\n\nThus, there is one integer sequence that $P$ can be."},{"iden":"sample input 3","content":"5\n2 2 2 2 2"},{"iden":"sample output 3","content":"16"},{"iden":"sample input 4","content":"13\n3 1 4 1 5 9 2 6 5 3 5 8 9"},{"iden":"sample output 4","content":"31155"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}