#include using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll ans = (n >= 50 ? 0 : 1); for (int i = 1; i <= n; i++) { ans *= i; ans %= (ll)1e12; } cout << ans << endl; return 0; }