import java.util.Scanner; public class Main{ static final Scanner s =new Scanner(System.in); static final int mod =1000000007; public static void main(String[] __){ long l=1, base=1000000006/*getBase()*/, n=s.nextLong(); { long buf=base, m=n/mod; while(m!=0){ if(m%2==1){ l*=buf; l%=mod; } buf*=buf; buf%=mod; m/=2; } } for(long i=n%mod; i>1; i--){ l*=i; l%=mod; } System.out.println(l); } static int getBase(){ long base=1; for(int i=2; i