s=' !';*a="M#O9`7p%?y";x;main(long n){scanf("%ld",&n);for(n<1e9+7?x=a[n/s]:0;n%s;)x=x*n--%';';printf("%d",x);}