#include <bits/stdc++.h>
using namespace std;
const long long N = 100000007;
long long n,a = 1,s;
int main(){
freopen("sakuras.in","r",stdin);
freopen("sakuras.out","w",stdout);
cin>>n;
for(int i = 2;i <= n;i++){
a = a * i % N;
}
cout<<a<<endl;
for(int i = 1;i <= 5000;i++){
for(int j = 1;j <= 5000;j++){
if(a * (i + j) % N == i * j % N){
s++;
s %= N;
}
}
}
cout<<s<<endl;
return 0;
}