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;
const int MX = 2021, md = 998244353;
const int precalc[MX] = {
    -1,     2,      2,      3,      4,      4,      5,      6,      6,
    6,      8,      9,      9,      10,     11,     12,     13,     13,
    14,     15,     16,     17,     19,     19,     20,     22,     22,
    23,     25,     26,     26,     28,     29,     29,     31,     34,
    35,     36,     37,     39,     40,     42,     44,     45,     45,
    46,     49,     50,     52,     54,     56,     57,     58,     59,
    60,     64,     68,     68,     71,     73,     73,     76,     77,
    79,     80,     83,     85,     87,     88,     90,     94,     97,
    99,     102,    103,    104,    107,    110,    111,    115,    120,
    122,    125,    126,    129,    131,    134,    134,    138,    140,
    143,    147,    150,    152,    156,    158,    161,    165,    168,
    169,    173,    179,    181,    184,    186,    191,    194,    197,
    201,    205,    207,    210,    214,    219,    220,    223,    228,
    229,    232,    237,    243,    246,    249,    252,    256,    261,
    268,    273,    275,    279,    284,    286,    291,    297,    302,
    303,    309,    315,    317,    324,    330,    334,    337,    340,
    344,    348,    353,    360,    364,    369,    372,    378,    383,
    385,    393,    401,    403,    407,    414,    418,    423,    433,
    438,    445,    452,    454,    459,    464,    470,    473,    480,
    488,    493,    497,    502,    514,    521,    527,    535,    538,
    539,    546,    551,    555,    563,    572,    578,    585,    591,
    596,    603,    614,    622,    628,    636,    642,    648,    654,
    656,    668,    678,    685,    692,    700,    705,    710,    721,
    727,    734,    743,    752,    759,    766,    773,    780,    786,
    798,    806,    814,    819,    828,    836,    841,    849,    858,
    870,    881,    888,    895,    904,    914,    922,    935,    943,
    951,    958,    968,    978,    987,    995,    1001,   1015,   1024,
    1032,   1045,   1055,   1064,   1072,   1081,   1090,   1098,   1110,
    1119,   1130,   1138,   1147,   1160,   1170,   1177,   1186,   1198,
    1210,   1219,   1232,   1238,   1251,   1266,   1275,   1284,   1296,
    1309,   1320,   1334,   1346,   1355,   1365,   1374,   1384,   1396,
    1409,   1425,   1438,   1447,   1457,   1470,   1480,   1497,   1514,
    1519,   1531,   1550,   1562,   1574,   1583,   1595,   1606,   1619,
    1626,   1640,   1651,   1666,   1681,   1693,   1708,   1722,   1730,
    1741,   1756,   1774,   1785,   1804,   1827,   1837,   1845,   1857,
    1874,   1886,   1900,   1914,   1928,   1939,   1950,   1970,   1990,
    2006,   2020,   2035,   2048,   2061,   2080,   2094,   2110,   2131,
    2142,   2157,   2177,   2190,   2203,   2216,   2238,   2250,   2267,
    2283,   2297,   2314,   2327,   2342,   2362,   2374,   2389,   2404,
    2422,   2436,   2453,   2469,   2486,   2510,   2530,   2550,   2566,
    2585,   2603,   2619,   2632,   2652,   2674,   2691,   2708,   2722,
    2736,   2756,   2774,   2794,   2817,   2834,   2852,   2871,   2889,
    2911,   2935,   2957,   2978,   2997,   3012,   3028,   3053,   3077,
    3089,   3106,   3129,   3145,   3164,   3187,   3203,   3225,   3245,
    3268,   3289,   3306,   3321,   3343,   3371,   3394,   3414,   3430,
    3452,   3479,   3503,   3521,   3546,   3568,   3580,   3600,   3630,
    3648,   3671,   3702,   3723,   3739,   3766,   3791,   3812,   3835,
    3858,   3881,   3902,   3929,   3953,   3979,   3995,   4024,   4051,
    4069,   4093,   4123,   4140,   4160,   4193,   4215,   4241,   4265,
    4294,   4315,   4333,   4362,   4388,   4409,   4439,   4465,   4487,
    4505,   4541,   4573,   4592,   4622,   4650,   4670,   4696,   4721,
    4748,   4773,   4805,   4840,   4865,   4896,   4911,   4938,   4968,
    4991,   5023,   5054,   5082,   5107,   5134,   5157,   5191,   5232,
    5259,   5287,   5320,   5348,   5370,   5392,   5428,   5457,   5490,
    5525,   5556,   5582,   5607,   5639,   5675,   5702,   5725,   5761,
    5784,   5820,   5853,   5879,   5906,   5947,   5983,   6011,   6043,
    6071,   6099,   6135,   6163,   6190,   6220,   6256,   6290,   6324,
    6353,   6386,   6425,   6466,   6503,   6533,   6567,   6596,   6627,
    6658,   6687,   6717,   6760,   6802,   6830,   6862,   6893,   6927,
    6961,   7002,   7039,   7067,   7102,   7144,   7179,   7217,   7260,
    7295,   7335,   7378,   7415,   7451,   7488,   7527,   7558,   7594,
    7623,   7663,   7700,   7727,   7776,   7817,   7859,   7896,   7934,
    7962,   7994,   8033,   8084,   8127,   8166,   8201,   8238,   8276,
    8322,   8362,   8409,   8448,   8480,   8517,   8551,   8592,   8630,
    8674,   8725,   8764,   8798,   8835,   8886,   8926,   8968,   9023,
    9062,   9100,   9146,   9179,   9218,   9265,   9306,   9348,   9393,
    9438,   9482,   9529,   9574,   9626,   9669,   9707,   9752,   9790,
    9833,   9878,   9938,   9982,   10023,  10075,  10121,  10171,  10221,
    10274,  10308,  10350,  10396,  10454,  10497,  10527,  10578,  10627,
    10665,  10727,  10778,  10817,  10861,  10920,  10957,  11001,  11058,
    11104,  11147,  11207,  11253,  11304,  11363,  11418,  11465,  11510,
    11553,  11608,  11668,  11713,  11764,  11810,  11854,  11894,  11947,
    12002,  12053,  12115,  12172,  12215,  12267,  12325,  12377,  12433,
    12492,  12548,  12605,  12659,  12712,  12767,  12809,  12866,  12925,
    12974,  13039,  13095,  13147,  13192,  13254,  13314,  13368,  13427,
    13486,  13543,  13601,  13657,  13712,  13763,  13826,  13880,  13935,
    13987,  14047,  14113,  14170,  14225,  14282,  14345,  14410,  14469,
    14520,  14564,  14637,  14700,  14756,  14822,  14874,  14935,  15001,
    15064,  15129,  15190,  15248,  15314,  15375,  15435,  15497,  15557,
    15605,  15665,  15734,  15800,  15866,  15937,  15990,  16049,  16113,
    16178,  16256,  16333,  16385,  16444,  16515,  16582,  16647,  16722,
    16793,  16852,  16921,  16990,  17045,  17111,  17188,  17258,  17331,
    17403,  17468,  17527,  17581,  17654,  17717,  17789,  17870,  17944,
    18009,  18071,  18143,  18213,  18288,  18364,  18430,  18497,  18563,
    18637,  18717,  18789,  18858,  18930,  18997,  19067,  19137,  19216,
    19285,  19359,  19437,  19497,  19579,  19662,  19740,  19809,  19882,
    19956,  20029,  20106,  20179,  20241,  20323,  20401,  20477,  20561,
    20628,  20703,  20781,  20862,  20950,  21027,  21105,  21171,  21259,
    21335,  21413,  21504,  21580,  21661,  21747,  21824,  21902,  21990,
    22065,  22146,  22218,  22300,  22391,  22476,  22561,  22645,  22729,
    22791,  22880,  22970,  23056,  23131,  23222,  23293,  23365,  23456,
    23549,  23641,  23735,  23826,  23895,  23980,  24064,  24158,  24245,
    24324,  24419,  24515,  24596,  24686,  24766,  24842,  24926,  25031,
    25116,  25206,  25303,  25395,  25489,  25573,  25662,  25747,  25838,
    25919,  26021,  26108,  26174,  26280,  26389,  26472,  26560,  26655,
    26744,  26835,  26935,  27025,  27111,  27210,  27314,  27408,  27490,
    27582,  27681,  27791,  27898,  28001,  28094,  28175,  28278,  28385,
    28473,  28577,  28688,  28781,  28863,  28965,  29063,  29153,  29281,
    29379,  29456,  29553,  29662,  29760,  29863,  29963,  30057,  30164,
    30273,  30371,  30483,  30574,  30687,  30806,  30901,  30996,  31100,
    31212,  31294,  31422,  31545,  31643,  31748,  31864,  31961,  32053,
    32164,  32270,  32371,  32483,  32589,  32694,  32793,  32906,  33026,
    33132,  33246,  33359,  33467,  33576,  33674,  33783,  33883,  33999,
    34111,  34218,  34331,  34428,  34555,  34675,  34789,  34918,  35026,
    35137,  35240,  35360,  35469,  35597,  35723,  35827,  35933,  36051,
    36159,  36280,  36405,  36517,  36629,  36749,  36870,  37008,  37130,
    37233,  37357,  37483,  37599,  37709,  37848,  37962,  38078,  38208,
    38317,  38428,  38555,  38685,  38812,  38929,  39063,  39187,  39299,
    39420,  39552,  39697,  39823,  39942,  40076,  40175,  40288,  40425,
    40571,  40702,  40837,  40969,  41081,  41195,  41328,  41466,  41599,
    41748,  41878,  41994,  42111,  42232,  42374,  42505,  42644,  42782,
    42896,  43012,  43157,  43278,  43404,  43551,  43699,  43826,  43956,
    44088,  44211,  44354,  44510,  44658,  44793,  44925,  45066,  45199,
    45317,  45453,  45603,  45730,  45868,  46032,  46161,  46297,  46445,
    46596,  46733,  46883,  47023,  47160,  47311,  47458,  47597,  47722,
    47864,  48019,  48159,  48294,  48442,  48587,  48724,  48871,  49025,
    49174,  49331,  49495,  49636,  49775,  49928,  50089,  50239,  50402,
    50544,  50686,  50831,  50970,  51128,  51288,  51415,  51574,  51746,
    51887,  52031,  52198,  52340,  52483,  52662,  52796,  52944,  53113,
    53282,  53433,  53586,  53746,  53891,  54054,  54207,  54365,  54520,
    54668,  54853,  55018,  55169,  55323,  55485,  55640,  55786,  55949,
    56117,  56275,  56456,  56620,  56773,  56930,  57084,  57237,  57414,
    57588,  57747,  57931,  58091,  58244,  58422,  58595,  58782,  58970,
    59136,  59284,  59448,  59631,  59799,  59981,  60144,  60306,  60473,
    60636,  60802,  60962,  61143,  61324,  61516,  61689,  61857,  62033,
    62176,  62355,  62552,  62728,  62903,  63088,  63274,  63439,  63625,
    63795,  63973,  64165,  64363,  64537,  64714,  64894,  65065,  65255,
    65432,  65626,  65815,  66000,  66175,  66355,  66521,  66721,  66909,
    67097,  67270,  67460,  67648,  67832,  68020,  68196,  68375,  68581,
    68769,  68951,  69136,  69320,  69517,  69713,  69914,  70085,  70292,
    70451,  70660,  70871,  71050,  71228,  71431,  71647,  71824,  72035,
    72222,  72408,  72605,  72829,  73034,  73222,  73415,  73608,  73802,
    73994,  74196,  74404,  74595,  74790,  75023,  75219,  75422,  75636,
    75828,  76019,  76239,  76457,  76637,  76840,  77063,  77265,  77479,
    77693,  77905,  78082,  78283,  78503,  78725,  78932,  79131,  79352,
    79549,  79756,  79980,  80189,  80413,  80637,  80855,  81070,  81254,
    81457,  81681,  81908,  82141,  82374,  82577,  82770,  82995,  83220,
    83432,  83656,  83905,  84138,  84342,  84553,  84765,  84983,  85219,
    85464,  85686,  85902,  86117,  86353,  86580,  86770,  86991,  87230,
    87450,  87661,  87895,  88114,  88333,  88594,  88832,  89049,  89279,
    89515,  89740,  89971,  90188,  90428,  90663,  90903,  91151,  91378,
    91601,  91835,  92089,  92316,  92530,  92781,  93012,  93256,  93519,
    93740,  93966,  94231,  94494,  94740,  94974,  95214,  95433,  95670,
    95909,  96157,  96413,  96664,  96903,  97141,  97360,  97587,  97846,
    98093,  98348,  98625,  98875,  99118,  99375,  99621,  99874,  100114,
    100399, 100659, 100904, 101157, 101393, 101638, 101890, 102147, 102410,
    102659, 102920, 103190, 103426, 103676, 103945, 104205, 104476, 104771,
    105025, 105280, 105573, 105825, 106074, 106335, 106579, 106843, 107119,
    107365, 107639, 107904, 108166, 108442, 108735, 108989, 109239, 109509,
    109779, 110040, 110309, 110575, 110839, 111140, 111421, 111687, 111940,
    112213, 112489, 112764, 113039, 113313, 113582, 113845, 114151, 114421,
    114700, 114969, 115277, 115574, 115840, 116139, 116418, 116700, 116993,
    117247, 117522, 117828, 118091, 118380, 118687, 118965, 119241, 119562,
    119849, 120113, 120418, 120703, 120986, 121288, 121576, 121856, 122142,
    122441, 122723, 123011, 123304, 123589, 123909, 124205, 124493, 124791,
    125097, 125384, 125708, 125999, 126298, 126630, 126932, 127223, 127543,
    127860, 128145, 128466, 128755, 129067, 129367, 129658, 129937, 130253,
    130567, 130894, 131228, 131547, 131855, 132156, 132468, 132789, 133094,
    133407, 133695, 134001, 134312, 134613, 134919, 135255, 135585, 135906,
    136234, 136544, 136837, 137145, 137469, 137824, 138164, 138471, 138808,
    139115, 139444, 139805, 140117, 140418, 140769, 141073, 141377, 141703,
    142022, 142348, 142698, 143032, 143347, 143675, 144014, 144354, 144691,
    145015, 145356, 145698, 146025, 146386, 146726, 147042, 147380, 147749,
    148106, 148422, 148770, 149128, 149431, 149779, 150113, 150437, 150791,
    151157, 151507, 151831, 152173, 152497, 152846, 153192, 153545, 153916,
    154267, 154632, 155018, 155363, 155683, 156043, 156399, 156719, 157073,
    157433, 157781, 158146, 158508, 158885, 159237, 159600, 159983, 160332,
    160678, 161035, 161402, 161776, 162143, 162528, 162877, 163237, 163651,
    164024, 164369, 164728, 165140, 165498, 165838, 166220, 166584, 166948,
    167291, 167683, 168063, 168413, 168801, 169174, 169534, 169917, 170324,
    170684, 171045, 171439, 171845, 172213, 172607, 173005, 173373, 173753,
    174113, 174505, 174892, 175273, 175662, 176063, 176444, 176821, 177217,
    177589, 177955, 178368, 178803, 179196, 179577, 179995, 180368, 180778,
    181194, 181569, 181954, 182361, 182777, 183196, 183544, 183938, 184367,
    184740, 185167, 185582, 185965, 186354, 186789, 187199, 187572, 187971,
    188391, 188783, 189221, 189657, 190064, 190453, 190881, 191318, 191707,
    192102, 192523, 192959, 193347, 193748, 194194, 194608, 195021, 195443,
    195849, 196242, 196688, 197122, 197546, 197992, 198451, 198870, 199283,
    199697, 200120, 200564, 201002, 201485, 201934, 202311, 202739, 203187,
    203600, 204048, 204511, 204938, 205344, 205797, 206234, 206655, 207109,
    207551, 207984, 208455, 208856, 209294, 209769, 210186, 210641, 211096,
    211536, 211981, 212453, 212896, 213324, 213787, 214258, 214683, 215128,
    215591, 216020, 216491, 216954, 217403, 217858, 218318, 218799, 219261,
    219723, 220212, 220691, 221145, 221580, 222036, 222481, 222946, 223430,
    223891, 224354, 224800, 225265, 225730, 226231, 226706, 227149, 227623,
    228097, 228561, 229076, 229538, 229993, 230507, 230959, 231446, 231933,
    232413, 232870, 233405, 233888, 234336, 234800, 235280, 235772, 236282,
    236739, 237223, 237723, 238229, 238717, 239225, 239712, 240176, 240717,
    241220, 241713, 242206, 242698, 243172, 243687, 244174, 244627, 245123,
    245676, 246173, 246690, 247205, 247690, 248192, 248671, 249186, 249703,
    250192, 250734, 251298, 251787, 252286, 252848, 253401, 253883, 254390,
    254896, 255394, 255922, 256474, 256983, 257463, 257984, 258518, 259039,
    259549, 260093, 260599, 261133, 261657, 262192, 262705, 263246, 263780,
    264335, 264839, 265394, 265936, 266485, 267062, 267589, 268091, 268608,
    269132, 269646, 270195, 270691, 271263, 271831, 272358, 272904, 273480,
    274014, 274568, 275161, 275683, 276220, 276803, 277358, 277855, 278437,
    279005, 279554, 280114, 280675, 281217, 281760, 282338, 282917, 283491,
    284027, 284554, 285092, 285658, 286202, 286787, 287362, 287900, 288489,
    289072, 289605, 290205, 290801, 291393, 292013, 292557, 293100, 293668,
    294253, 294844, 295431, 295990, 296592, 297175, 297748, 298308, 298909,
    299464, 300055, 300684, 301251, 301808, 302397, 303017, 303586, 304197,
    304828, 305435, 306042, 306672, 307232, 307820, 308418, 309031, 309634,
    310232, 310812, 311434, 312015, 312585, 313216, 313824, 314424, 315063,
    315677, 316261, 316866, 317522, 318135, 318758, 319356, 319964, 320596,
    321210, 321836, 322445, 323035, 323681, 324342, 324958, 325564, 326214,
    326809, 327399, 328048, 328695, 329311, 329943, 330615, 331245, 331845,
    332519, 333159, 333779, 334435, 335049, 335680, 336299, 336964, 337643,
    338287, 338921, 339602, 340254, 340861, 341524, 342168, 342791, 343434,
    344095, 344744, 345374, 346051, 346692, 347318, 347991, 348680, 349370,
    350033, 350697, 351349, 351964, 352646, 353339, 353996, 354623, 355299,
    355985, 356645, 357330, 358013, 358716, 359346, 360017, 360708, 361363,
    362026, 362711, 363432, 364119, 364798, 365513, 366172, 366852, 367597,
    368258, 368930, 369665, 370375, 371017, 371705, 372396, 373084, 373803,
    374494, 375189, 375882, 376578, 377320, 378043, 378732, 379414, 380139,
    380835, 381514, 382257, 382935, 383633, 384391, 385119, 385808, 386552,
    387262, 387963, 388698, 389406, 390094, 390831, 391564, 392279, 393013,
    393679, 394402, 395177, 395953, 396667, 397401, 398112, 398816, 399554,
    400317, 401011, 401763, 402532, 403272, 403976, 404700, 405460, 406207,
    406986, 407717, 408479, 409195, 409925, 410672, 411433, 412149, 412926,
    413683, 414442, 415224, 415982, 416746, 417540, 418304, 419010, 419774,
    420520, 421313, 422080, 422820, 423591, 424385, 425113, 425896, 426675,
    427447, 428196, 428997, 429752, 430501, 431328, 432112, 432898, 433680,
    434456, 435194, 436040, 436853, 437638, 438419, 439238, 439990, 440732,
    441537, 442312, 443097, 443906, 444715, 445539, 446337, 447113, 447938,
    448733, 449544, 450366, 451175, 451946};
int a[MX], pre[MX];
bool check(int len, int n, int k) {
  vector<int> v(a, a + len);
  for (int it = 0; it < k; it++) {
    int sum = accumulate(v.begin(), v.end(), 0);
    if (sum > n) return false;
    reverse(v.begin(), v.end());
    vector<int> nxt;
    for (size_t i = 0; i < v.size(); i++)
      for (int j = 0; j < v[i]; j++) nxt.push_back(i + 1);
    v = nxt;
  }
  return true;
}
int brute(int p, int n, int k) {
  if (check(p, n, k) == false) return 0;
  int ans = (p > 0 ? 1 : 0);
  for (int x = (p > 0 ? a[p - 1] : 1); x <= n; x++) {
    a[p] = x;
    int f = brute(p + 1, n, k);
    if (f == 0) break;
    ans += f;
  }
  return ans;
}
int solveOne(int n) {
  static int dp[MX][MX];
  for (int sum = 1; sum <= n; sum++)
    for (int x = sum; x > 0; x--) {
      dp[sum][x] = (x == sum ? 1 : 0);
      if (x + 1 <= sum) {
        dp[sum][x] += dp[sum][x + 1];
        dp[sum][x] %= md;
      }
      if (x <= sum - x) {
        dp[sum][x] += dp[sum - x][x];
        dp[sum][x] %= md;
      }
    }
  int ans = 0;
  for (int k = 1; k <= n; k++) {
    ans += dp[k][1];
    ans %= md;
  }
  return ans;
}
int solveTwo(int n) {
  static vector<int> dp[MX][MX];
  for (int sum = 1; sum <= n; sum++)
    for (int k = 1; k * (k + 1) / 2 <= sum; k++) {
      int mx = sum / (k * (k + 1) / 2);
      dp[sum][k].resize(mx + 1);
      for (int x = mx; x > 0; x--) {
        dp[sum][k][x] = 0;
        if (k == 1 && x == sum) dp[sum][k][x] += 1;
        if (x + 1 <= mx) {
          dp[sum][k][x] += dp[sum][k][x + 1];
          dp[sum][k][x] %= md;
        }
        if (x < dp[sum - k * x][k - 1].size()) {
          dp[sum][k][x] += dp[sum - k * x][k - 1][x];
          dp[sum][k][x] %= md;
        }
      }
    }
  int ans = 0;
  for (int sum = 1; sum <= n; sum++)
    for (int k = 1; k <= n; k++) {
      if (dp[sum][k].size() < 2) continue;
      ans += dp[sum][k][1];
      ans %= md;
    }
  return ans;
}
int main() {
  int n, k;
  ignore = scanf("%d %d", &n, &k);
  if (k == 1)
    printf("%d\n", solveOne(n));
  else if (k == 2)
    printf("%d\n", solveTwo(n));
  else if (k == 3)
    printf("%d\n", precalc[n] - 1);
  else
    printf("%d\n", brute(0, n, k));
  return 0;
}