#include using namespace std; int main() { constexpr int64_t mod = 1000000007; const int64_t fact[] = {1, 668123525, 724464507, 586445753}; char s[12] = {}; for (int i = 0; i < 11; i++) { s[i] = getchar(); } if (isdigit(s[10])) { cout << 0 << endl; return 0; } int64_t n = 0; for (int i = 0; i < 10; i++) { if (not isdigit(s[i])) break; n *= 10; n += s[i] - '0'; } n--; if (n > mod) { cout << 0 << endl; return 0; } int64_t ans = fact[n / 300000000]; for (int i = n / 300000000 * 300000000 + 1; i <= n; i++) { ans *= mod - i; ans %= mod; } cout << ans << endl; }