#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
long long  res[N];
const int M = 1e9+7;
int main()
{
    int n,t;
    res[1] = 1;
    for(int i=2;i<=N-10;i++) res[i]=res[i-1]*i%M;
    cin>>t;
    while(t--) {
        cin>>n;
        printf("%lld\n",res[n]);
    }
    return 0;
}