6683.Bit Strings

Time Limit: 1s Memory Limit: 512MB

Your task is to calculate the number of bit strings of length $n$ .

For example, if $n=3$ , the correct answer is $8$ , because the possible bit strings are 000, 001, 010, 011, 100, 101, 110, and 111.

Input Format(From the terminal/stdin)

The only input line has an integer $n$ .

  • $1 \le n \le 10^6$

Output Format(To the terminal/stdout)

Print the result modulo $10^9+7$ .

Sample Input

Copy
3
 \n

Sample Output

Copy
8
 \n
Source: CSES, Introductory Problems, 1617

Submit

请先 登录

© 2025 FAQs