Account
GitHubFeedback
Drafts and results saved on this device
Submit on CSES.fi
CSES Problemset/Introductory Problems

Bit Strings

#1617
Ask AI

Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.

Open Claude Desktop

Time limit:1.00 s
Memory limit:512 MB
Unsolved
Download Tests (.zip)

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

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

Input

The only input line has an integer nn.

Output

Print the result modulo 109+710^9+7.

Constraints
  • 1≤n≤1061 \le n \le 10^6
Sample Test Cases (1)
Example 1ID: sample-1
Input
3
Expected Output
8
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 chars
Test Bench
Download .zip
Input (stdin)
3
Expected Output
8