# Arup Guha
# 3/17/2026
# Solution to 2026 UCF HS Contest Problem I: Deluxe Defense

# Get input.
n = int(input())

# There are two sides to cover that are the same. The corresponding sum
# for each side is 1+3+5+... which is always a perfect square. The
# formula is below. Since for n=1 our sum is 1+3.
print( ( 2*(n+1)*(n+1) )%1000000007 )
