#include <iostream>
 
using std::cin;
using std::cout;
using std::endl;

static long fact100[] = {1, 437918130, 722479105, 419467694, 390998217, 688653593, 752369730, 314281677, 848793393, 302778600, 641419708, 359467170, 109119920, 291462451, 581232364, 367552188, 19055157, 519422664, 377413248, 184238535, 100292593, 867553799, 680805768, 637011622, 838031598, 954730329, 14705621, 854687367, 82350513, 562819783, 341406877, 11986940, 406550952, 924707067, 697304278, 812312671, 493805103, 750646179, 797131515, 125408444, 593395757, 743252791, 97269816, 625809105, 95830437, 318440909, 191279856, 448875092, 764072301, 941003529, 541108809, 339617910, 981977466, 917213110, 693389065, 939330647, 454991628, 655104206, 938437020, 681370120, 969117405, 153564086, 124768900, 190510895, 380720579, 742619942, 919179148, 860673190, 784044468, 356858318, 849641758, 257431766, 926581590, 488132488, 633627778, 593920661, 234400402, 266884017, 181686381, 657704891, 532467852, 928162624, 121630724, 523505981, 242416192, 940517951, 451602922, 692382743, 856456398, 303115999, 299200938, 638522519, 484820571, 4950879, 652993557, 595510479, 747441725, 565813117, 719760882, 162603635, 531950728, 765702160, 363728672, 790374244, 776372982, 160226878, 217226757, 800213188, 425234994, 877824191, 682831525, 230335073, 830834436, 706165316, 540595539, 144162001, 433393698, 893091420, 997675228, 844113510, 577889084, 874720012, 937682696, 117557725, 705155009, 72951350, 379968087, 950743483, 342781022, 184481043, 153223816, 558188636, 516225514, 438463836, 350269020, 332366222, 493498994, 753660595, 128078583, 238205526, 927344283, 470091512, 192044710, 849127063, 854869794, 502704967, 961189336, 188562846, 643851306, 204102562, 576865589, 574949854, 772036106, 417276573, 773301250, 463836195, 473281893, 894679367, 4336597, 363467250, 317614965, 728217456, 554126869, 874896552, 76366192, 677000234, 337033639, 284263197, 264056892, 538465762, 645000912, 157420482, 14755475, 572349905, 770650027, 208576717, 412197753, 283971481, 892302331, 872764474, 810673643, 764707385, 62691675, 425317917, 827016778, 685010988, 575309116, 86381823, 285454093, 583163727, 483115382, 953791654, 224496577, 413323992, 74107909, 779820672, 988628897, 796572345, 968946248, 444124793, 368774859, 887671982, 535354688, 145822049, 516927020, 988709092, 910325210, 790606609, 425401251, 824547428, 11347322, 841821068, 372729338, 910253320, 383651345, 626790213, 636443576, 633383307, 105562610, 725643552, 766392363, 418265499, 957763794, 832826328, 343383160, 237604935, 582419882, 608657845, 330910979, 511252139, 701339131, 463738716, 849664749, 739062237, 357088405, 324679509, 109741460, 455887877, 269923768, 424425198, 965651681, 471728725, 543062503, 485378429, 571604742, 321271335, 504455561, 509546975, 763368909, 150072577, 232201666, 695006444, 375079861, 765847341, 405049322, 304181169, 685687553, 228502082, 23642405, 733213722, 77721395, 994809954, 217921085, 750848255, 415201993, 877359318, 816254961, 208800253, 165312868, 912564763, 267878880, 620421028, 687272398, 965091903, 910284938, 959869931, 579283662, 460311839, 233130006, 832629547, 806918317, 789419725, 976360299, 66957513, 792006720, 964835096, 764310323, 943508794, 320822040, 855360826, 994209082, 998710584, 451541316, 540353405, 782850762, 83351016, 164658610, 399153119, 484179393, 900677914, 548996970, 540202385, 502085905, 305629510, 414973328, 733854511, 999551600, 929723194, 856256948, 190437395, 831650911, 189552007, 540085415, 264316037, 647368479, 724859258, 63875222, 549880942, 884378502, 48225947, 200360748, 217411774, 428675555, 204375967, 163813057, 11392828, 63816753, 122454906, 279161231, 177533667, 31612358, 140452161, 19981188, 287350626, 225047490, 810109242, 455285322, 682630228, 317104780, 38098465, 981996609, 566262664, 244205492, 11569855, 360664468, 210352560, 808795375, 66106220, 996704108, 52475795, 835874618, 706698117, 834011569, 82385442, 767403009, 260934484, 581004588, 146951720, 315181594, 18131026, 67347184, 660447354, 317161158, 310293330, 957769185, 795211642, 251210316, 376491240, 482209772, 337887965, 715730781, 169939932, 942501868, 896874971, 156760010, 409840176, 442596118, 448590113, 340183632, 448639753, 139475086, 446619980, 683372898, 330190835, 658072182, 120608013, 345266529, 873204774, 859866616, 327703544, 840550890, 500060231, 737050414, 343707056, 929913795, 364139378, 713522909, 605309034, 892609044, 95663389, 422550956, 440430257, 676836771, 616977443, 372816409, 516450892, 308156304, 727765485, 154582382, 122223283, 703248501, 916757163, 626613065, 673807982, 165855749, 104310832, 619362396, 666635368, 551617377, 725543210, 320014428, 83863469, 696839568, 820486897, 690587073, 476958860, 785342455, 964938385, 434274056, 793377933, 473720669, 105927603, 722446075, 463771653, 995091580, 249784900, 362569914, 441674995, 310891328, 443049614, 246899301, 965628034, 8254466, 860524980, 284046782, 649020090, 775603661, 428599344, 313235165, 263427830, 820210693, 584450609, 715520777, 908274787, 449173641, 87370462, 342675806, 667579940, 561795065, 279679436, 78896243, 594101806, 340351880, 104853227, 138938342, 130890251, 986495418, 544733609, 4904868, 918156620, 404489692, 770967340, 158370004, 816861962, 480737664, 420524209, 65348113, 118371296, 286699742, 510283129, 473058849, 602863780, 673888495, 988224796, 727422266, 795625516, 490010237, 643547208, 665131, 419311146, 784876961, 259406228, 321460624, 655258314, 98643949, 707960681, 345366515, 677618898, 819757880, 180025997, 737935835, 405543032, 644653663, 490584749, 695118839, 274538092, 632437141, 218813310, 317001033, 910311278, 570111271, 796146820, 110949981, 478241232, 875076691, 307006856, 17300606, 881553988, 227466914, 19672824, 445302346, 910482839, 824976273, 771616985, 270947557, 648646822, 178180365, 137542155, 231821182, 856901587, 993964922, 484362438, 16217817, 162346196, 574504715, 996863845, 926110356, 738560761, 655452606, 847777767, 703924556, 354719140, 551933392, 763321879, 354410308, 716633014, 1846113, 151195567, 397207557, 287250393, 553695703, 673890558, 607917045, 342267556, 791423907, 84651643, 967621908, 301902554, 650678899, 139731715, 307636910, 810633682, 948014515, 866935088, 81781900, 322819981, 80052847, 573932828, 697481470, 945729718, 9410113, 610388108, 997427770, 256656171, 627562817, 382326894, 562494885, 243742734, 278115231, 479250272, 387514542, 698268536, 155278258, 494100421, 212623047, 421826322, 603738319, 758527273, 20108421, 863619073, 821332424, 145077127, 73700185, 204576546, 189728558, 485502293, 841644761, 408411010, 117079890, 38907107, 309944332, 537278263, 217025729, 109877174, 557761881, 994419866, 217090673, 184824249, 189099472, 261873512, 667808941, 586325534, 253818913, 644423004, 981219272, 454235616, 701754988, 399397899, 785692610, 558429063, 364031813, 729194366, 92482293, 326481560, 788127248, 570445426, 823876596, 20603955, 865141725, 343095285, 26031301, 599138469, 726882647, 873729904, 381275973, 727797007, 386941508, 306915726, 183392789, 965201592, 616292959, 988382003, 843538214, 917204899, 346845309, 346668863, 73340530, 211574133, 101653426, 552055822, 392352826, 621654267, 953923388, 649516831, 344367172, 875418231, 749373796, 143428656, 348401571, 841064085, 727093888, 308500124, 232930518, 733485509, 223530088, 955719239, 372632899, 280379514, 793982951, 815003859, 716823510, 420238951, 258598151, 119317972, 532691113, 996762842, 245917194, 50278402, 340573112, 365772418, 972353660, 426309883, 723221198, 174677626, 399728595, 11650076, 709841844, 146676835, 334038704, 534725238, 837816787, 171414317, 303642327, 974225117, 842734160, 776201879, 74464463, 821426588, 38248328, 706358135, 296716438, 445075845, 550967966, 521492915, 274952061, 556614251, 984837941, 648055403, 343362475, 346080515, 256832184, 740061294, 495959165, 729601523, 779665586, 283275797, 197810318, 781285237, 322261298, 135677639, 604632373, 482730911, 262343442, 41660771, 590107402, 953568036, 946541117, 885083598, 382285276, 488546372, 993845228, 909184478, 271463541, 119198618, 592620584, 461343501, 554131598, 652118082, 21986535, 72902987, 687268896, 974594416, 932795074, 774765057, 809996715, 620738499, 399787621, 225908460, 129158745, 586852410, 796945456, 697021411, 269610437, 381569864, 516484640, 533382001, 851059476, 496376048, 117921789, 762631608, 388289544, 175140444, 127387258, 449693463, 568876602, 791130076, 116649615, 899544094, 666808812, 268154883, 130425525, 40221932, 937092326, 80681006, 358103796, 716404824, 842684285, 441825078, 646820416, 235503449, 135821388, 85455680, 158341399, 477414981, 167897791, 535112475, 396749090, 10704220, 234934482, 908432331, 293931387, 731582745, 517708259, 430870409, 980420392, 541663303, 47582098, 455847, 356474821, 316432065, 65533322, 85175307, 860604360, 25754605, 154738290, 446955362, 157986406, 781848501, 717265250, 612404709, 706983555, 387930108, 472703372, 677443725, 177799133, 678723533, 355862327, 142972046, 172238730, 511971513, 645452094, 527518247, 731876548, 273379339, 857639774, 841031050, 684168469, 916679331, 820059873, 456796817, 429183481, 526395816, 775373984, 192323739, 296194923, 11453925, 8278520, 409297079, 104345442, 868422849, 808037302, 743839810, 46575892, 772073181, 957942297, 186788115, 208353171, 135646592, 669701582, 639767834, 840311971, 566239834, 748856536, 516640190, 829180498, 126741093, 161917011, 188925427, 150241540, 772951297, 314136411, 385047709, 234466451, 661905614, 866978149, 839059042, 973857347, 733512306, 484001044, 688907798, 284583633, 843163128, 324217435, 258023744, 669468233, 956937740, 751439779, 199094586, 924317766, 652240854, 19122513, 239556480, 767073780, 140785202, 813367160, 936382197, 597461024, 615192889, 99527175, 845455419, 583838047, 319841973, 802260377, 115832001, 410302694, 791420576, 811802215, 885506163, 821500977, 971899082, 851076783, 60196672, 310722366, 460528297, 552700981, 180873604, 609943468, 121002913, 766255808, 312289913, 495303973, 432738621, 394225159, 138042435, 243477827, 749475337, 982506554, 786394249, 356445555, 307208212, 591254491, 619425827, 823014817, 366656624, 619489363, 370467112, 484246020, 270725331, 784373520, 439653758, 820309560, 908299141, 86224435, 932013969, 318639644, 898352741, 401192710, 659343882, 401578858, 851699976, 894437844, 330041436, 170941117, 14153059, 37693984, 616445558, 690716870, 874502721, 449868160, 438615741, 978160598, 698174607, 168356987, 967878048, 736417659, 453888345, 676617343, 274124047, 420072609, 641407652, 318526308, 878694635, 357869926, 315485067, 491981417, 239038656, 843844940, 132469174, 187019771, 523408116, 78568538, 436938993, 486874504, 190178115, 497209923, 995074790, 367421824, 91668637, 710596389, 130676774, 300098050, 904649983, 186399972, 478015100, 31995309, 124938003, 690394397, 711461277, 224418847, 893879446, 781314189, 667385447, 671417846, 234638808, 828492043, 306706238, 127550549, 408913764, 721516183, 331471082, 457992974};

static int const MODULO = 1e9 + 7;

static long
mmul(long a, long b)
{
  return (a * b) % MODULO;
}

static void
gen()
{
  cout << "static long fact100[] = {";
  bool first = true;
  for (int N = 0; N <= 1e5; N += 100)
  {
    long p = 1;
    for (int i = 1; i <= N; i++)
    {
      p = mmul(p, i);
    }
    if (first)
    {
      first = false;
    }
    else
    {
      cout << ", ";
    }
    cout << p;
  }
  cout << "};" << endl;
}

int
main()
{
  int N;
  cin >> N;
  if (N == 0)
  {
    gen();
  }
  long p = fact100[N / 100];
  int mod = N % 100;
  for (int i = 0; i < mod; i++)
  {
    p = mmul(p, N - i);
  }
  cout << p << endl;
  return 0;
}


Measured memory_bytes: 256