import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static final long MOD = 1000000007l; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextLong() % MOD; long answer = 1; for(int i = 2; i <= N; i++){ answer *= i; answer %= MOD; } System.out.println(answer); } }