Binary Strings


Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem types

A binary string consists only of the characters \(0\) and \(1\).

Given an integer \(N\), determine how many unique binary strings of length \(N\) there are.

Input Specification

The first line will contain the integer \(N\) (\(1 \le N \le 10^6\)).

Output Specification

Print the number of unique binary strings of length \(N\) modulo \(10^9+7\).

Sample Input

3

Sample Output

8

There are \(8\) binary strings of length \(3\): 000, 001, 010, 100, 011, 101, 110, 111.
Then, since the value of \(8\) modulo \(10^9+7\) is \(8\), we output \(8\).


Comments

There are no comments at the moment.