For this Question: Given an integer A, find the value of A + A<sup>2</sup> + A<sup>3</sup> +. . .+ A<sup>1000</sup>. As the answer can be large, output answer modulo 10<sup>9</sup>+7.The first and the only line of input contains a single integer A.

Constraints
1 <= A <= 10<sup>9</sup>Output a single integer, value of sum modulo 10<sup>9</sup>+7.Sample Input
1

Sample Output
1000

Explanation: 1 + 1<sup>2</sup> + 1<sup>3</sup> +. . + 1<sup>1000</sup> = 1000

Sample Input
157

Sample Output
731862470
, I have written this Solution Code: n = int(input())
if n == 1:
    print('1000')
else:
    print((n*(n**1000-1)//(n-1))%(10**9+7)), In this Programming Language: Python, Now tell me if this Code is compilable or not?