Problem: Let's define the function f of multiset a as the multiset of number of occurences of every number, that is present in a.

E.g., f(\{5, 5, 1, 2, 5, 2, 3, 3, 9, 5\}) = \{1, 1, 2, 2, 4\}.

Let's define f^k(a), as applying f to array a k times: f^k(a) = f(f^{k-1}(a)), f^0(a) = a. 

E.g., f^2(\{5, 5, 1, 2, 5, 2, 3, 3, 9, 5\}) = \{1, 2, 2\}.

You are given integers n, k and you are asked how many different values the function f^k(a) can have, where a is arbitrary non-empty array with numbers of size no more than n. Print the answer modulo 998 244 353.

Input

The first and only line of input consists of two integers n, k (1 ≤ n, k ≤ 2020).

Output

Print one number — the number of different values of function f^k(a) on all possible non-empty arrays with no more than n elements modulo 998 244 353.

Examples

Input


3 1


Output


6


Input


5 6


Output


1


Input


10 1


Output


138


Input


10 2


Output


33

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;
template <typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int answer2[2021] = {
    0,         1,         2,         4,         6,         8,         12,
    16,        20,        26,        33,        40,        50,        61,
    72,        87,        104,       121,       143,       167,       192,
    224,       259,       295,       339,       387,       437,       497,
    563,       631,       712,       801,       893,       1000,      1117,
    1238,      1379,      1532,      1691,      1872,      2069,      2274,
    2507,      2759,      3021,      3316,      3636,      3968,      4340,
    4741,      5158,      5623,      6124,      6644,      7219,      7838,
    8483,      9193,      9956,      10749,     11618,     12551,     13522,
    14581,     15715,     16895,     18181,     19555,     20985,     22534,
    24188,     25910,     27773,     29758,     31823,     34048,     36420,
    38887,     41541,     44362,     47296,     50445,     53790,     57268,
    60992,     64941,     69050,     73441,     78093,     82928,     88085,
    93545,     99221,     105264,    111654,    118292,    125351,    132808,
    140555,    148775,    157451,    166464,    176017,    186088,    196547,
    207613,    219275,    231383,    244181,    257649,    271629,    286389,
    301915,    318025,    335013,    352863,    371385,    390894,    411381,
    432628,    454985,    478448,    502781,    528357,    555175,    582975,
    612175,    642773,    674488,    707762,    742604,    778710,    816566,
    856180,    897219,    940204,    985166,    1031733,   1080475,   1131419,
    1184169,   1239342,   1296983,   1356651,   1419012,   1484114,   1551500,
    1621879,   1695319,   1771308,   1850620,   1933336,   2018911,   2108169,
    2201208,   2297430,   2397746,   2502260,   2610330,   2722917,   2840156,
    2961358,   3087567,   3218928,   3354697,   3495983,   3642979,   3794876,
    3952872,   4117166,   4286898,   4463357,   4646781,   4836231,   5033091,
    5237619,   5448835,   5668212,   5896052,   6131274,   6375467,   6628978,
    6890664,   7162208,   7444003,   7734806,   8036449,   8349358,   8672217,
    9006953,   9354056,   9712125,   10083238,  10467918,  10864668,  11275687,
    11701596,  12140784,  12595614,  13066740,  13552450,  14055271,  14575951,
    15112644,  15668044,  16242956,  16835452,  17448387,  18082666,  18736202,
    19412048,  20111207,  20831484,  21576103,  22346166,  23139309,  23959014,
    24806474,  25679197,  26580844,  27512739,  28472234,  29463255,  30487223,
    31541332,  32629717,  33753992,  34911161,  36105636,  37339129,  38608483,
    39918386,  41270741,  42662175,  44097665,  45579240,  47103389,  48675380,
    50297444,  51965815,  53686096,  55460717,  57285728,  59167038,  61107291,
    63102267,  65158298,  67278236,  69457647,  71703173,  74017922,  76397220,
    78848152,  81374045,  83969977,  86643390,  89397957,  92228464,  95142826,
    98144942,  101229335, 104404384, 107674355, 111033430, 114490480, 118050050,
    121706096, 125467978, 129340637, 133317637, 137408880, 141619696, 145943379,
    150390349, 154966353, 159664278, 164495221, 169465334, 174567181, 179812402,
    185207630, 190745063, 196437070, 202290722, 208297832, 214471372, 220819046,
    227332236, 234024685, 240904568, 247962863, 255214063, 262667022, 270312228,
    278164978, 286234669, 294511456, 303011440, 311744736, 320700935, 329897028,
    339343848, 349030595, 358975121, 369189027, 379660902, 390409679, 401447743,
    412763223, 424375956, 436299202, 448520551, 461060995, 473934631, 487128517,
    500664632, 514558170, 528795598, 543400126, 558387836, 573744623, 589494913,
    605655980, 622213039, 639191823, 656610611, 674454125, 692749413, 711516042,
    730737958, 750443631, 770653908, 791352191, 812568331, 834324553, 856603433,
    879436517, 902847437, 926818156, 951381682, 976563168, 4099492,   30514210,
    57589628,  85306270,  113700592, 142801114, 172587556, 203098326, 234363569,
    266362239, 299134671, 332713066, 367075477, 402264295, 438313522, 475200581,
    512969956, 551657858, 591240712, 631765230, 673269807, 715730192, 759195328,
    803705981, 849236828, 895839454, 943557047, 992363494, 44068385,  95206229,
    147505623, 201023388, 255807958, 311831397, 369153064, 427824496, 487816780,
    549192323, 612005495, 676226453, 741920607, 809145738, 877870910, 948164773,
    21843859,  95365195,  170556386, 247481995, 326109113, 406513189, 488762479,
    572823307, 658774643, 746688724, 836530571, 928383195, 24078565,  120069544,
    218198520, 318546165, 421075572, 525877907, 633038239, 742518685, 854414432,
    968815614, 87438920,  206872986, 328968347, 453684991, 581127521, 711396425,
    844450483, 980399334, 121104325, 263012188, 407993323, 556159472, 707467342,
    862037082, 21742139,  183027245, 347773661, 516105681, 687977935, 863522236,
    44625223,  227729465, 414728276, 605759711, 800776548, 1678892,   205100749,
    412749672, 624776404, 841334383, 64130169,  289810445, 520292122, 755525204,
    995674854, 242666962, 492939183, 748420053, 11043951,  277248052, 548968795,
    826394592, 111228413, 400148067, 695107338, 996053224, 304938931, 618461754,
    938323134, 266485705, 599657542, 939539742, 288103949, 642069557, 4892619,
    373288154, 749254152, 134490686, 525722455, 924960250, 333903686, 749288499,
    174893693, 607151626, 49831640,  499704271, 958468342, 428149344, 905531434,
    394069384, 890533841, 398746834, 915140080, 443519432, 980699729, 530135973,
    90380014,  660018827, 242507025, 834655014, 440333662, 57731445,  685428265,
    327312793, 979818225, 646807015, 326919230, 20100260,  724960464, 445426817,
    179689898, 926376784, 689434296, 467054085, 259635534, 67636119,  889248517,
    728401249, 583817590, 455447951, 343727870, 249159940, 171695795, 111790093,
    69969400,  46188140,  40920659,  54719059,  87539191,  139876752, 212310215,
    304798556, 417858551, 552096273, 707473286, 884529730, 85655813,  307305317,
    551796575, 819794852, 113024420, 428561753, 768858470, 135642780, 526016294,
    942464263, 386718944, 855908847, 354308016, 878387151, 432324935, 15164771,
    625137557, 266450752, 936428957, 638576648, 371863954, 137165895, 932725142,
    762810620, 626582104, 524045397, 455989888, 423373102, 426207739, 465318068,
    541705191, 655390132, 807231226, 31756,     230309868, 500717009, 812347797,
    166996485, 562085284, 2271079,   484090662, 12028957,  583770869, 202887175,
    866881439, 580516117, 342105701, 152707995, 13629947,  923199528, 886030181,
    901732338, 970401427, 94942626,  273271748, 507254806, 798088920, 149020450,
    556662914, 25776488,  554406495, 146205580, 798962253, 517814287, 301164405,
    150367985, 67122481,  51604520,  105225544, 229759217, 425401129, 693622328,
    38028387,  455325206, 948800819, 522142956, 173834135, 903714902, 717312272,
    613133632, 592841130, 658538957, 810513240, 52251704,  382438497, 803142905,
    317923380, 925559094, 629902187, 431076077, 331469545, 331453737, 432983464,
    638551309, 948559719, 366801210, 892362877, 529191570, 277651498, 140454039,
    118069315, 212705191, 427186772, 762022350, 221265904, 804352933, 515341098,
    354867194, 326002123, 429335701, 667357683, 45025401,  559459081, 216762560,
    18516829,  963645586, 60112845,  306128641, 704175658, 258818528, 970168275,
    842515586, 877025705, 79229451,  446448992, 983481097, 696012849, 583179154,
    648143130, 895002193, 326462196, 942303951, 750303778, 749720816, 943979940,
    339280291, 933190768, 732785659, 740935042, 958791609, 391816817, 43072438,
    912026743, 7802752,   330148788, 882123959, 669493206, 695721665, 962193014,
    474835362, 237326667, 251137633, 520604731, 53140084,  846792988, 909586559,
    247405746, 858394465, 750754246, 928855877, 396208736, 155935508, 214407497,
    573483969, 239992650, 218808848, 511899500, 126293510, 67131540,  336498036,
    939874412, 886191214, 177650056, 816439290, 813532359, 171259380, 892032030,
    987121993, 458989775, 312039446, 554340064, 190247731, 224405547, 665205096,
    517147203, 785129294, 479629886, 601790312, 160278279, 162409722, 611239747,
    515708618, 883486988, 719553697, 31374085,  825237504, 109806327, 887570467,
    173980604, 967350997, 281007176, 122022905, 494166105, 407566421, 871467145,
    891594172, 476645036, 636292538, 376468640, 704456494, 633884508, 169148844,
    317878624, 94165522,  500877553, 549521545, 252909642, 614147821, 645116879,
    359128633, 759536828, 858615088, 670184559, 199616008, 456076342, 455678262,
    204061423, 710812730, 992593907, 57087546,  910803590, 574489058, 52606119,
    355629098, 501385642, 496405940, 353385464, 89009754,  708372302, 228169324,
    662209601, 21192103,  315288343, 564234280, 775567459, 963495893, 148434937,
    334776318, 539020624, 780538691, 69369175,  417308184, 846208357, 366507629,
    990581601, 742800469, 630502657, 670176204, 883460752, 281642801, 878320815,
    699460721, 753282215, 59298265,  637292389, 501224629, 667762630, 162827328,
    993840757, 185191395, 756677652, 723256070, 104759855, 923677983, 197251829,
    940796077, 186540668, 941745138, 233023941, 84833664,  510274075, 533249412,
    182755374, 470736496, 421922611, 66384957,  416687540, 498415967, 342744454,
    962890790, 387081216, 644128500, 751429220, 734618126, 627204224, 445535459,
    216193513, 972158798, 734015645, 527580220, 388856310, 335680013, 396634600,
    609039037, 991518091, 575471572, 397817439, 478001526, 846754595, 545917246,
    594031697, 24719103,  875998610, 174324759, 947465042, 243725929, 81702509,
    495640411, 531883334, 213503574, 574243060, 662056959, 501005941, 127887212,
    588805121, 910618243, 133218512, 302672915, 446909595, 605461704, 829682246,
    148621598, 599731023, 239714015, 95269077,  208853774, 635554991, 406788266,
    564788163, 168367852, 246681986, 845318641, 26866235,  818270692, 272033193,
    445824164, 374957907, 108373769, 707657978, 211289781, 666458813, 142263581,
    671605576, 310523780, 125163156, 153454167, 449806808, 86269708,  100576649,
    549097486, 506350884, 13458062,  127041193, 922419846, 445911578, 754478669,
    927830417, 12279270,  66937845,  174250656, 380587697, 750811208, 370171231,
    285167681, 562968847, 291743679, 519940080, 318868546, 776183306, 945878146,
    899972768, 730988366, 493251967, 261336543, 130967404, 158658661, 421614882,
    20628860,  12707152,  477790317, 520088808, 200711955, 600650281, 827648657,
    945239349, 40847139,  220591941, 552275882, 126323616, 54387162,  405115528,
    272052035, 770724671, 974240641, 977600013, 902112079, 821919869, 835346437,
    69590627,  598193275, 526419836, 982245085, 49221025,  827385502, 456150126,
    16921020,  616907451, 398326125, 445792323, 872069933, 822324071, 386269896,
    678814317, 849983684, 992944578, 230169981, 711427157, 536971647, 829928506,
    750518734, 399187449, 903383119, 430407721, 82787824,  992424335, 333898762,
    211944724, 764822284, 171031048, 539425950, 16528792,  779694449, 949037197,
    672479592, 136938780, 461677482, 801437079, 351137906, 234583322, 610007792,
    678772965, 571161944, 450799257, 523942404, 925747125, 827190849, 441382441,
    906768537, 401831311, 145013192, 281732848, 992923671, 509575369, 978997834,
    591775204, 581173314, 105347252, 355958340, 577531072, 932256320, 621850941,
    895346944, 922647312, 910475842, 119628455, 720935779, 931602258, 20940476,
    166152473, 589904096, 570285841, 294629546, 989503045, 943810490, 351707939,
    447451356, 527518020, 793126563, 489942277, 920573674, 297045783, 867939978,
    951036135, 762396203, 562537736, 675979784, 328329691, 787050094, 390700103,
    369451959, 3251647,   636280362, 512284990, 916964169, 210969211, 639650377,
    503518932, 171271459, 898887147, 996751988, 845467616, 711973387, 913290115,
    844052807, 780688227, 52483577,  63204205,  100842470, 503728417, 692194640,
    962604635, 666222051, 235036633, 974124668, 249765682, 504305588, 58887119,
    284642544, 643429173, 465817567, 136935902, 131604513, 790142952, 513821731,
    790845229, 975217570, 479466794, 807406769, 327066330, 460911231, 732340725,
    520339915, 262951627, 498388629, 618733374, 78085995,  429958981, 81723308,
    498661857, 257155539, 773271158, 532755233, 126559258, 985171647, 611732006,
    614114717, 441191760, 606969926, 742019943, 310596392, 841573218, 987086186,
    227214448, 107976234, 300123439, 300122319, 673403661, 113468701, 130125453,
    308793816, 362830451, 821242729, 289945655, 501048357, 5034471,   421924217,
    512004582, 840798457, 53497858,  926994928, 52962706,  90139005,  844955326,
    925315273, 16383964,  944380288, 341068837, 908168052, 506406384, 779798076,
    459556610, 427694533, 353368869, 987446457, 244502927, 810803066, 466331324,
    148513544, 570134608, 534035904, 8331858,   727841745, 522457414, 388330301,
    88282946,  473067291, 572997367, 176169365, 160177726, 585170342, 267045348,
    111113539, 209972873, 404631941, 630663703, 15891039,  425492102, 826177200,
    380139416, 981136230, 627883151, 514503794, 567660834, 813723420, 486753687,
    542032423, 39763648,  248006427, 156781620, 855861479, 657153761, 579428577,
    748208609, 513357387, 926846799, 152795869, 576643268, 289867578, 487363763,
    601905030, 756728477, 187431881, 366486101, 455239552, 725775579, 698612632,
    570785796, 653776272, 513833449, 386619355, 624159464, 839830718, 310771890,
    429004335, 856331393, 910902020, 31211249,  923636103, 951992222, 597293686,
    620678214, 425964135, 539662322, 777393227, 587740380, 544135714, 516412006,
    997535359, 612646536, 285633265, 556964929, 101481071, 898630281, 543086594,
    755510445, 579659107, 655320976, 759276753, 994142842, 55156240,  767950734,
    302840365, 403193792, 955619908, 192811148, 911465174, 60762306,  930597541,
    384813423, 422834218, 409401999, 261483656, 42655397,  185654679, 667497431,
    616012872, 535634024, 465236300, 595081431, 505128043, 297911065, 229838918,
    954863232, 644578393, 621616629, 619668809, 874269669, 781534711, 155203568,
    298544981, 679631588, 196363661, 223437561, 302960421, 415707569, 13515608,
    711111667, 579817498, 145367927, 102616550, 608808893, 271169275, 863302053,
    637904289, 278854856, 644436632, 81821175,  355669397, 412926362, 694414611,
    54964503,  523954378, 645471547, 359968052, 788681183, 578339180, 757516980,
    543668132, 685352031, 307195916, 718443169, 779550867, 708487860, 914265514,
    368626240, 385746710, 477151865, 727231752, 554305063, 571809873, 981656437,
    307575381, 267724556, 186540228, 690769600, 613443344, 401302903, 790721374,
    727259790, 785195760, 815380773, 877456509, 678366032, 184913442, 573962746,
    688844774, 615590381, 655185331, 787354778, 222573289, 385819653, 400649394,
    601825283, 547114325, 504156653, 937477029, 539450670, 725832509, 97920471,
    479449229, 445348233, 730594182, 304484480, 894786804, 382687354, 876560383,
    273561006, 592828975, 97930544,  845841741, 13489606,  9860998,   68421312,
    514040917, 917510780, 688308603, 308780830, 508891301, 878693386, 66009142,
    962612313, 349447869, 35423592,  87475629,  471775284, 173657943, 432842386,
    412943722, 273276422, 434735230, 261832859, 94695322,  538414491, 165565660,
    500216590, 340390443, 466957742, 598423909, 725453495, 848234975, 881436172,
    17384986,  475986551, 377031529, 116313095, 146616970, 791369126, 660770759,
    442876658, 674063447, 181118811, 892086543, 567267306, 252434553, 127166268,
    173109099, 666299275, 44529020,  516739924, 597276795, 981825180, 123700694,
    771218496, 893689192, 186364740, 647026179, 520412782, 750467161, 594401455,
    576251690, 898939173, 82686046,  938126856, 937708508, 866266355, 837669720,
    592269847, 192098560, 56599567,  205018788, 982166672, 126610968, 938619123,
    60417736,  543727449, 991858781, 341671185, 977129533, 805270389, 67427416,
    488407271, 285632388, 14676454,  750097623, 29649783,  728251065, 284545139,
    556536248, 757362815, 688661754, 547958159, 886920909, 884824772, 86017887,
    389554799, 362382452, 901387773, 271187862, 429145282, 639559481, 533268963,
    477399118, 109697280, 437009732, 246573242, 558050899, 769525916, 95771306,
    948310065, 128586186, 284645364, 239433246, 197531416, 262176453, 669504156,
    47035150,  956016187, 65719535,  426811397, 82878087,  133507613, 78179433,
    442537803, 778649268, 40922458,  251593381, 425296807, 979895406, 455498689,
    336348140, 519375925, 69001416,  954861501, 568999861, 509858687, 250808184,
    681235443, 956325832, 62464217,  403147748, 700827766, 466928140, 637554148,
    515176398, 149795715, 22443053,  30396022,  776517995, 304057563, 118663311,
    392194212, 737923023, 292227227, 807328628, 486366474, 105656841, 18213417,
    27146017,  568185794, 610861760, 575485082, 574289279, 205540203, 522752620,
    333270567, 879011810, 868278398, 815981806, 629348113, 681343498, 217569422,
    822853626, 558777805, 414816215, 675983147, 105119088, 456129819, 732440196,
    415776134, 47436640,  362356034, 581767393, 53878908,  265868162, 197087158,
    19715774,  994283891, 879601062, 692140281, 487561921, 816836420, 567642642,
    607355689, 306514041, 438405919, 706833065, 320929650, 963820865, 198423360,
    88690196,  255514716, 136230757, 678220326, 461778683, 820740133, 610412824,
    389074564, 415513953, 470181881, 119235685, 566285570, 544376546, 648805630,
    57411430,  472513135, 549839358, 460814473, 908922894, 632604973, 822302676,
    209497342, 637437945, 348203115, 120140171, 935484533, 111328523, 499287897,
    252518612, 781006347, 49191678,  397551074, 369547591, 57602174,  29628582,
    981866228, 172305602, 419451595, 608755665, 183579945, 251157466, 910564423,
    826106642, 423353828, 47391678,  608297608, 884565347, 500283800, 646314918,
    483212749, 942783583, 533742331, 829699471, 109690883, 222547425, 198046322,
    687692016, 924422819, 424788175, 250113151, 46671996,  852255937, 180806582,
    123215899, 281116366, 646137554, 798974091, 939664901, 580003018, 819694156,
    499911123, 686681966, 44025974,  86828623,  479361944, 482795682, 334082239,
    331747923, 373923999, 459103235, 562543041, 261299985, 357067424, 542958458,
    116393997, 725573864, 826163315, 476472589, 219872186, 312144263, 617781034,
    620954098, 426198734, 746432063, 53622136,  342557307, 225740431, 205602345,
    221155702, 823277998, 601212187, 480384464, 3535769,   887816399, 102725500,
    223963789, 159050633, 957392975, 291875829, 301770979, 178251381, 728053808,
    388998366, 538921108, 179429083, 90842450,  896984163, 845866725, 122285137,
    646599177, 966297568, 728006335, 210666282, 313205620, 203101314, 571117110,
    732363248, 433621931, 836581792, 728542915, 497481491, 837532722, 68797065,
    281347647, 765049368, 431670062, 143738365, 844354663, 103557556, 616285894,
    52186140,  692847745, 146205666, 859772859, 908168103, 866663048, 42575440,
    356511459, 430929446, 493996760, 391715441, 858619339, 120258044, 10774654,
    456000940, 744986166, 779480405, 750308184, 85974036,  821455289, 495322621,
    747106472, 829809642, 699519098, 291060249, 144604665, 718685165, 322228492,
    861716848, 385148203, 647733719, 11142634,  187678686, 471448817, 752910717,
    504844089, 638316867, 660145656, 887190178, 938205410, 22685276,  389776982,
    455169670, 216818093, 953907225, 966859160, 134545046, 857012024, 414108695,
    653238616, 200909244, 401726601, 175532403, 462982324, 780720725, 211227999,
    114449495, 274266061, 34860355,  279450347, 162224033, 387607811, 470355417,
    36014479,  254116262, 376210714, 605592670, 685596838, 713699658, 579729932,
    705253438, 149500294, 596855417, 261947189, 275875218, 236676089, 258331666,
    666770221, 88077034,  649645173, 994703633, 891533801, 606738414, 218132987,
    757084516, 748798616, 834053130, 435907800, 454848061, 225665108, 684348765,
    240747497, 51017762,  696074989, 220363945, 736578462, 606792767, 636112630,
    38860062,  83231486,  476715801, 669911334, 983215395, 163307065, 37203372,
    117426394, 327612522, 26518142,  60111240,  673141579, 902792264, 80512222,
    916641064, 282895284, 139918703, 821383558, 185688185, 979945249, 317045299,
    195576536, 313768729, 709417768, 698383262, 84918327,  993882020, 224386598,
    846662841, 248552502, 869960735, 229613930, 130244107, 840523811, 490144985,
    475944810, 72111343,  190112496, 170340,    958784367, 949925569, 89317722,
    205789585, 331483534, 713405904, 747573452, 801813954, 441614579, 818479730,
    832456776, 557414216, 102873697, 91804879,  302528568, 6951786,   751955981,
    223243330, 55924757,  929576348, 637192543, 395141788, 223041477, 226038587,
    419289643, 377266189, 732673109, 520809215, 85910357,  806463433, 963649584,
    896936296, 954598470, 891351471, 270553404, 635101334, 453581286, 742501526,
    476757332, 75450402,  249184754, 637400501, 859528283, 565150907, 299445750,
    133382188, 899310419, 302600188, 119353704, 622678142, 923468026, 773351888,
    143508061, 806988289, 758134418, 930612039, 33005788,  565782753, 700837546,
    345657600, 796738642, 736132589, 545470203, 603207283, 382769936, 24466838,
    277829946, 697786903, 470647192, 17813970,  268061582, 746430442, 850508249,
    189199847, 921549557, 735647740, 223317638, 490981509, 827724999, 128410260,
    755745874, 930465676, 165634029, 403513576, 124905360, 788468406, 248407584,
    578709202, 525013854, 177342297, 556707812, 34961665,  278191847, 609205586,
    372126098, 163907792, 963136209, 447993159, 496047089, 117653547, 679828181,
    713471676, 629064912, 863216292, 962508869, 128274828, 241791128, 247384760,
    523436716, 791735602, 778639832, 444330549, 739656161, 571437254, 887142803,
    279942023, 233828457, 106060063, 535941826, 7924040,   707429221, 751629473,
    36517261,  17755331,  712729289, 865451558, 646409217, 416607917, 200692067,
    336641799, 979387316, 888416017, 31441130,  812551235, 183568672, 212932908,
    31424549,  241309553, 500637949, 140847875, 895968732, 507531234, 989819307,
    704222810, 968377693, 990420049, 247715974, 154506580, 613966233, 731438735,
    544753645, 174851692, 867009055, 819581331, 900249795, 33976925,  115700533,
    306832774, 744165078, 590225935, 847228311, 421781113, 303456866, 905212099,
    464688273, 385135389, 66986870,  648381623, 543616219, 726650628, 830838423,
    881299720, 30430100,  553617,    49082078,  118721011, 637730178, 726601839,
    743225133, 447119252, 463146180, 208385423, 406090433, 847940444, 660655236,
    187362725, 53963296,  760978639, 935870485, 727985672, 694013267, 421472410,
    278749113, 574270987, 548985657, 507424656, 218051871, 279660929, 659280914,
    311132094, 913499526, 843714904, 972816220, 801302355, 867476364, 721533143,
    431879083, 476638337, 848673933, 955413763, 6814103,   222642992, 129999699,
    472751165, 506490940, 675251949, 84218479,  833073632, 104687862, 198676209,
    902164536, 963080920, 738674105, 550935311, 561012005, 59856346,  770931835,
    143486216, 284759565, 215939822, 548445724, 129434351,
};
const int answer3[2021] = {
    0,   1,   0,   1,   1,   0,   1,   1,   0,   0,   2,   1,   0,   1,   1,
    1,   1,   0,   1,   1,   1,   1,   2,   0,   1,   2,   0,   1,   2,   1,
    0,   2,   1,   0,   2,   3,   1,   1,   1,   2,   1,   2,   2,   1,   0,
    1,   3,   1,   2,   2,   2,   1,   1,   1,   1,   4,   4,   0,   3,   2,
    0,   3,   1,   2,   1,   3,   2,   2,   1,   2,   4,   3,   2,   3,   1,
    1,   3,   3,   1,   4,   5,   2,   3,   1,   3,   2,   3,   0,   4,   2,
    3,   4,   3,   2,   4,   2,   3,   4,   3,   1,   4,   6,   2,   3,   2,
    5,   3,   3,   4,   4,   2,   3,   4,   5,   1,   3,   5,   1,   3,   5,
    6,   3,   3,   3,   4,   5,   7,   5,   2,   4,   5,   2,   5,   6,   5,
    1,   6,   6,   2,   7,   6,   4,   3,   3,   4,   4,   5,   7,   4,   5,
    3,   6,   5,   2,   8,   8,   2,   4,   7,   4,   5,   10,  5,   7,   7,
    2,   5,   5,   6,   3,   7,   8,   5,   4,   5,   12,  7,   6,   8,   3,
    1,   7,   5,   4,   8,   9,   6,   7,   6,   5,   7,   11,  8,   6,   8,
    6,   6,   6,   2,   12,  10,  7,   7,   8,   5,   5,   11,  6,   7,   9,
    9,   7,   7,   7,   7,   6,   12,  8,   8,   5,   9,   8,   5,   8,   9,
    12,  11,  7,   7,   9,   10,  8,   13,  8,   8,   7,   10,  10,  9,   8,
    6,   14,  9,   8,   13,  10,  9,   8,   9,   9,   8,   12,  9,   11,  8,
    9,   13,  10,  7,   9,   12,  12,  9,   13,  6,   13,  15,  9,   9,   12,
    13,  11,  14,  12,  9,   10,  9,   10,  12,  13,  16,  13,  9,   10,  13,
    10,  17,  17,  5,   12,  19,  12,  12,  9,   12,  11,  13,  7,   14,  11,
    15,  15,  12,  15,  14,  8,   11,  15,  18,  11,  19,  23,  10,  8,   12,
    17,  12,  14,  14,  14,  11,  11,  20,  20,  16,  14,  15,  13,  13,  19,
    14,  16,  21,  11,  15,  20,  13,  13,  13,  22,  12,  17,  16,  14,  17,
    13,  15,  20,  12,  15,  15,  18,  14,  17,  16,  17,  24,  20,  20,  16,
    19,  18,  16,  13,  20,  22,  17,  17,  14,  14,  20,  18,  20,  23,  17,
    18,  19,  18,  22,  24,  22,  21,  19,  15,  16,  25,  24,  12,  17,  23,
    16,  19,  23,  16,  22,  20,  23,  21,  17,  15,  22,  28,  23,  20,  16,
    22,  27,  24,  18,  25,  22,  12,  20,  30,  18,  23,  31,  21,  16,  27,
    25,  21,  23,  23,  23,  21,  27,  24,  26,  16,  29,  27,  18,  24,  30,
    17,  20,  33,  22,  26,  24,  29,  21,  18,  29,  26,  21,  30,  26,  22,
    18,  36,  32,  19,  30,  28,  20,  26,  25,  27,  25,  32,  35,  25,  31,
    15,  27,  30,  23,  32,  31,  28,  25,  27,  23,  34,  41,  27,  28,  33,
    28,  22,  22,  36,  29,  33,  35,  31,  26,  25,  32,  36,  27,  23,  36,
    23,  36,  33,  26,  27,  41,  36,  28,  32,  28,  28,  36,  28,  27,  30,
    36,  34,  34,  29,  33,  39,  41,  37,  30,  34,  29,  31,  31,  29,  30,
    43,  42,  28,  32,  31,  34,  34,  41,  37,  28,  35,  42,  35,  38,  43,
    35,  40,  43,  37,  36,  37,  39,  31,  36,  29,  40,  37,  27,  49,  41,
    42,  37,  38,  28,  32,  39,  51,  43,  39,  35,  37,  38,  46,  40,  47,
    39,  32,  37,  34,  41,  38,  44,  51,  39,  34,  37,  51,  40,  42,  55,
    39,  38,  46,  33,  39,  47,  41,  42,  45,  45,  44,  47,  45,  52,  43,
    38,  45,  38,  43,  45,  60,  44,  41,  52,  46,  50,  50,  53,  34,  42,
    46,  58,  43,  30,  51,  49,  38,  62,  51,  39,  44,  59,  37,  44,  57,
    46,  43,  60,  46,  51,  59,  55,  47,  45,  43,  55,  60,  45,  51,  46,
    44,  40,  53,  55,  51,  62,  57,  43,  52,  58,  52,  56,  59,  56,  57,
    54,  53,  55,  42,  57,  59,  49,  65,  56,  52,  45,  62,  60,  54,  59,
    59,  57,  58,  56,  55,  51,  63,  54,  55,  52,  60,  66,  57,  55,  57,
    63,  65,  59,  51,  44,  73,  63,  56,  66,  52,  61,  66,  63,  65,  61,
    58,  66,  61,  60,  62,  60,  48,  60,  69,  66,  66,  71,  53,  59,  64,
    65,  78,  77,  52,  59,  71,  67,  65,  75,  71,  59,  69,  69,  55,  66,
    77,  70,  73,  72,  65,  59,  54,  73,  63,  72,  81,  74,  65,  62,  72,
    70,  75,  76,  66,  67,  66,  74,  80,  72,  69,  72,  67,  70,  70,  79,
    69,  74,  78,  60,  82,  83,  78,  69,  73,  74,  73,  77,  73,  62,  82,
    78,  76,  84,  67,  75,  78,  81,  88,  77,  78,  66,  88,  76,  78,  91,
    76,  81,  86,  77,  78,  88,  75,  81,  72,  82,  91,  85,  85,  84,  84,
    62,  89,  90,  86,  75,  91,  71,  72,  91,  93,  92,  94,  91,  69,  85,
    84,  94,  87,  79,  95,  96,  81,  90,  80,  76,  84,  105, 85,  90,  97,
    92,  94,  84,  89,  85,  91,  81,  102, 87,  66,  106, 109, 83,  88,  95,
    89,  91,  100, 90,  86,  99,  104, 94,  82,  92,  99,  110, 107, 103, 93,
    81,  103, 107, 88,  104, 111, 93,  82,  102, 98,  90,  128, 98,  77,  97,
    109, 98,  103, 100, 94,  107, 109, 98,  112, 91,  113, 119, 95,  95,  104,
    112, 82,  128, 123, 98,  105, 116, 97,  92,  111, 106, 101, 112, 106, 105,
    99,  113, 120, 106, 114, 113, 108, 109, 98,  109, 100, 116, 112, 107, 113,
    97,  127, 120, 114, 129, 108, 111, 103, 120, 109, 128, 126, 104, 106, 118,
    108, 121, 125, 112, 112, 120, 121, 138, 122, 103, 124, 126, 116, 110, 139,
    114, 116, 130, 109, 111, 127, 130, 127, 117, 134, 124, 112, 121, 132, 145,
    126, 119, 134, 99,  113, 137, 146, 131, 135, 132, 112, 114, 133, 138, 133,
    149, 130, 116, 117, 121, 142, 131, 139, 138, 114, 116, 145, 121, 126, 147,
    148, 127, 130, 132, 123, 143, 156, 148, 135, 132, 141, 133, 118, 136, 150,
    127, 138, 164, 129, 136, 148, 151, 137, 150, 140, 137, 151, 147, 139, 125,
    142, 155, 140, 135, 148, 145, 137, 147, 154, 149, 157, 164, 141, 139, 153,
    161, 150, 163, 142, 142, 145, 139, 158, 160, 127, 159, 172, 141, 144, 167,
    142, 143, 179, 134, 148, 169, 169, 151, 153, 160, 145, 163, 153, 158, 155,
    148, 185, 165, 151, 154, 162, 155, 146, 163, 168, 158, 181, 164, 153, 157,
    154, 153, 177, 174, 159, 184, 160, 153, 178, 173, 187, 188, 166, 148, 164,
    183, 168, 182, 163, 162, 167, 163, 166, 160, 181, 181, 192, 173, 168, 176,
    143, 179, 197, 176, 175, 185, 186, 165, 186, 170, 178, 192, 198, 174, 177,
    180, 171, 190, 177, 194, 189, 185, 175, 180, 166, 200, 188, 188, 173, 190,
    188, 184, 188, 176, 179, 206, 188, 182, 185, 184, 197, 196, 201, 171, 207,
    159, 209, 211, 179, 178, 203, 216, 177, 211, 187, 186, 197, 224, 205, 188,
    193, 193, 194, 192, 202, 208, 191, 195, 233, 196, 203, 214, 192, 191, 220,
    218, 180, 203, 223, 202, 214, 214, 212, 177, 201, 220, 222, 207, 199, 221,
    197, 207, 224, 209, 224, 224, 218, 215, 184, 203, 224, 227, 233, 233, 203,
    193, 225, 225, 212, 224, 249, 233, 204, 211, 212, 218, 236, 245, 222, 216,
    215, 236, 227, 190, 221, 239, 220, 211, 234, 219, 219, 261, 238, 217, 230,
    236, 225, 231, 217, 240, 235, 240, 248, 227, 223, 234, 254, 227, 214, 251,
    231, 244, 263, 221, 226, 265, 263, 246, 234, 240, 219, 237, 239, 248, 256,
    251, 239, 238, 219, 227, 259, 247, 255, 277, 250, 243, 257, 246, 253, 240,
    285, 260, 245, 253, 236, 245, 252, 257, 263, 249, 261, 270, 236, 250, 269,
    260, 271, 295, 254, 255, 293, 252, 249, 261, 244, 264, 276, 246, 274, 265,
    262, 276, 293, 254, 250, 270, 270, 261, 269, 266, 264, 301, 281, 266, 253,
    273, 276, 275, 275, 274, 269, 263, 306, 270, 279, 269, 308, 297, 266, 299,
    279, 282, 293, 254, 275, 306, 263, 289, 307, 278, 276, 321, 287, 264, 305,
    285, 283, 302, 288, 280, 286, 299, 282, 288, 293, 285, 320, 296, 288, 298,
    306, 287, 324, 291, 299, 332, 302, 291, 320, 317, 285, 321, 289, 312, 300,
    291, 279, 316, 314, 327, 334, 319, 308, 301, 312, 321, 305, 313, 288, 306,
    311, 301, 306, 336, 330, 321, 328, 310, 293, 308, 324, 355, 340, 307, 337,
    307, 329, 361, 312, 301, 351, 304, 304, 326, 319, 326, 350, 334, 315, 328,
    339, 340, 337, 324, 341, 342, 327, 361, 340, 316, 338, 369, 357, 316, 348,
    358, 303, 348, 334, 324, 354, 366, 350, 324, 342, 324, 349, 346, 353, 371,
    351, 365, 386, 345, 320, 360, 356, 320, 354, 360, 348, 365, 362, 377, 352,
    363, 383, 349, 346, 357, 367, 374, 367, 385, 349, 360, 414, 373, 345, 359,
    412, 358, 340, 382, 364, 364, 343, 392, 380, 350, 388, 373, 360, 383, 407,
    360, 361, 394, 406, 368, 394, 398, 368, 380, 360, 392, 387, 381, 389, 401,
    381, 377, 396, 372, 366, 413, 435, 393, 381, 418, 373, 410, 416, 375, 385,
    407, 416, 419, 348, 394, 429, 373, 427, 415, 383, 389, 435, 410, 373, 399,
    420, 392, 438, 436, 407, 389, 428, 437, 389, 395, 421, 436, 388, 401, 446,
    414, 413, 422, 406, 393, 446, 434, 424, 446, 459, 419, 413, 414, 423, 444,
    438, 483, 449, 377, 428, 448, 413, 448, 463, 427, 406, 453, 437, 421, 454,
    442, 433, 471, 401, 438, 475, 417, 455, 455, 440, 445, 472, 443, 428, 463,
    471, 425, 445, 463, 429, 471, 463, 449, 455, 460, 481, 462, 462, 489, 479,
    454, 435, 456, 445, 465, 484, 461, 463, 446, 465, 465, 501, 475, 443, 474,
    474, 464, 515, 462, 455, 514, 452, 487, 487, 480, 457, 535, 483, 448, 464,
    480, 492, 510, 457, 484, 500, 506, 488, 508, 487, 464, 541, 503, 493, 493,
    492, 474, 515, 487, 453, 496, 553, 497, 517, 515, 485, 502, 479, 515, 517,
    489, 542, 564, 489, 499, 562, 553, 482, 507, 506, 498, 528, 552, 509, 480,
    521, 534, 521, 510, 544, 506, 534, 524, 535, 513, 541, 534, 555, 504, 555,
    542, 549, 577, 527, 502, 517, 524, 514, 549, 496, 572, 568, 527, 546, 576,
    534, 554, 593, 522, 537, 583, 555, 497, 582, 568, 549, 560, 561, 542, 543,
    578, 579, 574, 536, 527, 538, 566, 544, 585, 575, 538, 589, 583, 533, 600,
    596, 592, 620, 544, 543, 568, 585, 591, 587, 559, 602, 583, 573, 560, 601,
    555, 591, 629, 567, 557, 589, 620, 569, 611, 631, 607, 607, 630, 560, 588,
    598, 613, 603, 598, 580, 622, 581, 570, 631, 608, 600, 639, 614, 584, 605,
    656, 613, 623, 598, 608, 632, 614, 626, 609, 590, 646, 661, 616, 606, 650,
    595, 590, 649, 647, 616, 632, 672, 630, 600, 674, 640, 620, 656, 614, 631,
    619, 665, 679, 644, 634, 681, 652, 607, 663, 644, 623, 643, 661, 649, 630,
    677, 641, 626, 673, 689, 690, 663, 664, 652, 615, 682, 693, 657, 627, 676,
    686, 660, 685, 683, 703, 630, 671, 691, 655, 663, 685, 721, 687, 679, 715,
    659, 680, 745, 661, 672, 735, 710, 642, 688, 691, 688, 719, 691, 695, 693,
    696, 742, 723, 689, 682, 725, 696, 679, 743, 678, 698, 758, 728, 689, 744,
    710, 701, 735, 708, 688, 737, 733, 715, 734, 666, 723, 775, 776, 714, 734,
    711, 704, 738, 763, 694, 752, 769, 740, 704, 724, 760, 747, 779, 731, 762,
    716, 730, 747, 761, 716, 777, 757, 759, 782, 758, 764, 794, 764, 706, 764,
    746, 793, 767, 740, 771, 794, 728, 783, 779, 772, 749, 801, 755, 749, 827,
    784, 786, 782, 776, 738, 846, 813, 785, 781, 819, 752, 742, 805, 775, 785,
    809, 809, 824, 798, 776, 825, 795, 811, 822, 809, 771,
};
ostream &operator<<(ostream &out, const vector<int> &b) {
  out << "{";
  for (auto t : b) out << t << ' ';
  out << "}";
  return out;
}
const int maxn = 2030;
const int MOD = 998244353;
int n, k;
bool expand(vector<int> cur, int curk) {
  if ((int)cur.size() > n) return false;
  if (curk == k) {
    return true;
  }
  int sum = accumulate((cur).begin(), (cur).end(), 0);
  if (sum > n) return false;
  sort((cur).begin(), (cur).end());
  reverse((cur).begin(), (cur).end());
  vector<int> nxt;
  for (int i = 0; i < (int)cur.size(); i++) {
    for (int j = 0; j < cur[i]; j++) nxt.push_back(i + 1);
  }
  return expand(nxt, curk + 1);
}
const int maxcnt = 70;
vector<int> all;
int answer = 0;
int ans[maxn][maxn];
void go(int cur, int mx) {
  for (int v = 1; v <= mx; v++) {
    all.push_back(v);
    if (expand(all, 0)) {
      answer++;
      go(cur + 1, v);
    } else {
      all.pop_back();
      break;
    }
    all.pop_back();
  }
}
inline void upd(int &a, int b) { a = (a + b) % MOD; }
void solve1() {
  ans[0][1] = 1;
  for (int s = 0; s <= n; s++) {
    for (int l = 1; l <= n; l++) {
      upd(ans[s][l + 1], ans[s][l]);
      if (s + l <= n) upd(ans[s + l][l], ans[s][l]);
    }
  }
  int curans = 0;
  for (int i = 1; i <= n; i++) upd(curans, ans[i][n]);
  printf("%d\n", curans);
}
int main() {
  scanf("%d%d", &n, &k);
  if (k == 1) {
    solve1();
  } else if (k == 2) {
    printf("%d\n", answer2[n]);
  } else if (k == 3) {
    int curans = 0;
    for (int i = 1; i <= n; i++) upd(curans, answer3[i]);
    printf("%d\n", curans);
  } else {
    go(0, n + 1);
    printf("%d\n", answer);
  }
  return 0;
}