import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); static void myout(Object t){System.out.println(t);}//standard output static void myerr(Object t){System.err.println(t);}//standard error static String getStr(){return sc.next();} static int getInt(){return Integer.parseInt(getStr());} static long getLong(){return Long.parseLong(getStr());} static boolean hasNext(){return sc.hasNext();} static char[] mySplit(String str){return str.toCharArray();} static String toKaigyo(String[] list){return String.join("\n",list);} static String toHanSp(String[] list){return String.join(" ",list);} public static void main(String[] args){ long N = getLong(); long output = 1; final int mod = 1000000007; for(int i = 1; i <= N; i++){ output = (output * i) % mod; } myout(output); } //Method addition frame start //Method addition frame end }