fork(1) download
#include <bits/stdc++.h>
#define m 1000000007
using namespace std;

int main() {
	// your code goes here
	long long int t;
	cin>>t;
	while(t--){
		long long int n;cin>>n;
		if(n==0 || n==1)cout<<1<<"\n";
		else{
			long long int fact=1;
			for(int i=1;i<=n;i++){
				fact=(fact*i)%m;
			}
			//fact=fact%m;
			cout<<fact<<"\n";
		}
	}
	return 0;
}
Success #stdin #stdout 0s 5464KB
stdin
3
5
20
50
stdout
120
146326063
318608048