{"raw_statement":[{"iden":"problem statement","content":"How many infinite sequences $a_1, a_2, ...$ consisting of {${1, ... ,n}$} satisfy the following conditions?\n\n*   The $n$\\-th and subsequent elements are all equal. That is, if $n \\leq i,j$, $a_i = a_j$.\n*   For every integer $i$, the $a_i$ elements immediately following the $i$\\-th element are all equal. That is, if $i < j < k\\leq i+a_i$, $a_j = a_k$.\n\nFind the count modulo $10^9+7$."},{"iden":"constraints","content":"*   $1 \\leq n \\leq 10^6$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$n$"},{"iden":"sample input 1","content":"2"},{"iden":"sample output 1","content":"4\n\nThe four sequences that satisfy the conditions are:\n\n*   $1, 1, 1, ...$\n*   $1, 2, 2, ...$\n*   $2, 1, 1, ...$\n*   $2, 2, 2, ...$"},{"iden":"sample input 2","content":"654321"},{"iden":"sample output 2","content":"968545283"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}