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(); for(long i=n/mod;i>0;i--) { l*=base; l%=mod; } 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