C. Array
time limit per test
2 seconds
memory limit per test
256 megabytes
output
standard output
兔子克里斯从小就对阵列感兴趣。目前,他正在研究长度为n的数组,只包含从1到n的整数。他不擅长数学,这就是为什么一些简单的事情会让他发疯。例如,昨天他开始热衷于计算有多少不同的漂亮阵列。Chris认为,如果一个数组满足以下两个条件之一,它就很漂亮:
1.从第二个元素开始,每个元素不超过前一个元素
2.每个元素,从第二个元素开始,不少于前一个元素
克里斯对自己和数学都非常生气,于是他来到斯特维和布莱恩那里寻求帮助。然而,他们只是嘲笑他,说答案太简单,没有意思。帮助兔子克里斯找到答案。
输入
单行包含一个整数n,它是数组的大小(1≤n≤1e5)。
输出
你必须将答案打印在单行上。因为它可能很长,所以应该以1000000007为模打印。
Chris the Rabbit has been interested in arrays ever since he was a child. At the moment he is researching arrays with the length of
n, containing only integers from
1 to
n. He is not good at math, that's why some simple things drive him crazy. For example, yesterday he grew keen on counting how many different beautiful arrays there are. Chris thinks that an array is beautiful if it meets one of the two conditions:
-
each elements, starting from the second one, is no more than the preceding one
-
each element, starting from the second one, is no less than the preceding one
Having got absolutely mad at himself and at math, Chris came to Stewie and Brian to ask them for help. However, they only laughed at him and said that the answer is too simple and not interesting. Help Chris the Rabbit to find the answer at last.
Output
You must print the answer on a single line. As it can be rather long, you should print it modulo
1000000007.