#C1922. Counting Palindromic Strings
Counting Palindromic Strings
Counting Palindromic Strings
Given a positive integer \( n \), consider all strings of length \(2n\) that are palindromic and consist only of the characters a
and b
. A string \( S \) of length \(2n\) is palindromic if \( S[i] = S[2n-i+1] \) for all \( 1 \leq i \leq 2n \). It can be shown that the total number of such palindromic strings is \(2^n\). Since the number can be very large, output the answer modulo \(10^9+7\).
Input Format: A single line containing one integer \( n \).
Output Format: Output a single integer, the number of different palindromic strings of length \(2n\) modulo \(10^9+7\).
inputFormat
The input consists of a single integer \( n \) on one line read from standard input.
outputFormat
Output a single integer representing \(2^n \pmod{10^9+7}\) to standard output.
## sample1
2