Training Camp

AtCoder
IDabc055_b
Time2000ms
Memory256MB
Difficulty
Snuke loves working out. He is now exercising $N$ times. Before he starts exercising, his _power_ is $1$. After he exercises for the $i$\-th time, his power gets multiplied by $i$. Find Snuke's power after he exercises $N$ times. Since the answer can be extremely large, print the answer modulo $10^{9}+7$. ## Constraints * $1 ≤ N ≤ 10^{5}$ ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
3
Output #1
6

*   After Snuke exercises for the first time, his power gets multiplied by $1$ and becomes $1$.
*   After Snuke exercises for the second time, his power gets multiplied by $2$ and becomes $2$.
*   After Snuke exercises for the third time, his power gets multiplied by $3$ and becomes $6$.
Input #2
10
Output #2
3628800
Input #3
100000
Output #3
457992974

Print the answer modulo $10^{9}+7$.
API Response (JSON)
{
  "problem": {
    "name": "Training Camp",
    "description": {
      "content": "Snuke loves working out. He is now exercising $N$ times. Before he starts exercising, his _power_ is $1$. After he exercises for the $i$\\-th time, his power gets multiplied by $i$. Find Snuke's power ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc055_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Snuke loves working out. He is now exercising $N$ times.\nBefore he starts exercising, his _power_ is $1$. After he exercises for the $i$\\-th time, his power gets multiplied by $i$.\nFind Snuke's power ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments