Arch Rivals

2

2 votes
Easy
Problem

Ronak and Ankesh are arch rivals and regularly give each other challenges. This time Ankesh has challenged Ronak to write a program that calculates n!e mod 109+7 as fast as possible. Ronak being busy in his networks assignment, asks for your help in solving this.

So, you have to write a program that calculates n!e mod (109+7) and prints it in the output

Input:

Single integer n .

Output:

Single integer that is the answer to the problem.

Constraints:

0n105

Notes:

  1. e is natural log base
  2. n denotes n factorial =123n
  3. n = Greatest Integer n.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

5!e = 120e = 326.193

326.193=326

Editor Image

?