#include <bits/stdc++.h>
using namespace std;
int n, k;
long long c[310][310], g[310][310][310], f[2][310];
int main() {
  c[0][0] = 1;
  for (int i = 1; i <= 64; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 777777777;
  }
  g[0][0][0] = 1;
  for (int i = 1; i <= 64; ++i) {
    memcpy(g[i], g[i - 1], sizeof(g[i - 1]));
    for (int p = 1; p <= 64; ++p)
      if (p == i) {
        for (int j = p; j <= 64; ++j)
          for (int k = 0; j + k <= 64; ++k)
            g[i][j][k] =
                (g[i][j][k] + g[i - 1][j - p][k] * c[j + k][p]) % 777777777;
      } else {
        for (int j = 0; j <= 64; ++j)
          for (int k = p; j + k <= 64; ++k)
            g[i][j][k] =
                (g[i][j][k] + g[i - 1][j][k - p] * c[j + k][p]) % 777777777;
      }
  }
  f[0][128] = 149150650;
  f[0][127] = 232966794;
  f[0][126] = 487159055;
  f[0][125] = 30540300;
  f[0][124] = 458170419;
  f[0][123] = 480722613;
  f[0][122] = 605295159;
  f[0][121] = 37220268;
  f[0][120] = 292922628;
  f[0][119] = 530767740;
  f[0][118] = 138718678;
  f[0][117] = 257373347;
  f[0][116] = 44594256;
  f[0][115] = 340129188;
  f[0][114] = 610216692;
  f[0][113] = 416259390;
  f[0][112] = 657133515;
  f[0][111] = 479433192;
  f[0][110] = 317959019;
  f[0][109] = 500636381;
  f[0][108] = 12787348;
  f[0][107] = 669954708;
  f[0][106] = 68131467;
  f[0][105] = 526429710;
  f[0][104] = 423048528;
  f[0][103] = 254706039;
  f[0][102] = 42951006;
  f[0][101] = 282387700;
  f[0][100] = 303717460;
  f[0][99] = 341834527;
  f[0][98] = 333633477;
  f[0][97] = 65589678;
  f[0][96] = 376367145;
  f[0][95] = 4802637;
  f[0][94] = 415705878;
  f[0][93] = 352406796;
  f[0][92] = 72018835;
  f[0][91] = 52410890;
  f[0][90] = 241289776;
  f[0][89] = 343900011;
  f[0][88] = 624827616;
  f[0][87] = 353784942;
  f[0][86] = 615036450;
  f[0][85] = 508213986;
  f[0][84] = 138765186;
  f[0][83] = 668528077;
  f[0][82] = 437011960;
  f[0][81] = 710035809;
  f[0][80] = 735862995;
  f[0][79] = 676063665;
  f[0][78] = 294926121;
  f[0][77] = 565603164;
  f[0][76] = 111746817;
  f[0][75] = 335375775;
  f[0][74] = 27702486;
  f[0][73] = 299270097;
  f[0][72] = 434962491;
  f[0][71] = 501639192;
  f[0][70] = 286484229;
  f[0][69] = 578826927;
  f[0][68] = 685038942;
  f[0][67] = 700348950;
  f[0][66] = 654339672;
  f[0][65] = 143420103;
  f[0][64] = 104733162;
  f[0][63] = 590145264;
  f[0][62] = 371892402;
  f[0][61] = 506813013;
  f[0][60] = 596108961;
  f[0][59] = 533997135;
  f[0][58] = 244690731;
  f[0][57] = 261388683;
  f[0][56] = 663532359;
  f[0][55] = 429824745;
  f[0][54] = 435828036;
  f[0][53] = 705296781;
  f[0][52] = 474743430;
  f[0][51] = 427694175;
  f[0][50] = 346831137;
  f[0][49] = 54648783;
  f[0][48] = 310453920;
  f[0][47] = 465470131;
  f[0][46] = 33785059;
  f[0][45] = 738490312;
  f[0][44] = 39521181;
  f[0][43] = 671903001;
  f[0][42] = 487033953;
  f[0][41] = 685013007;
  f[0][40] = 478908360;
  f[0][39] = 93337440;
  f[0][38] = 208947235;
  f[0][37] = 407997044;
  f[0][36] = 591219559;
  f[0][35] = 594676173;
  f[0][34] = 777331779;
  f[0][33] = 387099846;
  f[0][32] = 265613565;
  f[0][31] = 739707108;
  f[0][30] = 95984586;
  f[0][29] = 500815609;
  f[0][28] = 703097347;
  f[0][27] = 561797418;
  f[0][26] = 495032139;
  f[0][25] = 705610017;
  f[0][24] = 137170026;
  f[0][23] = 676047609;
  f[0][22] = 498253248;
  f[0][21] = 750976272;
  f[0][20] = 124604900;
  f[0][19] = 756201264;
  f[0][18] = 517628076;
  f[0][17] = 773939082;
  f[0][16] = 652682670;
  f[0][15] = 55761813;
  f[0][14] = 671961765;
  f[0][13] = 168908523;
  f[0][12] = 243630450;
  f[0][11] = 175889805;
  f[0][10] = 231881111;
  f[0][9] = 478771358;
  f[0][8] = 621882744;
  f[0][7] = 678182556;
  f[0][6] = 341766705;
  f[0][5] = 36099042;
  f[0][4] = 154906374;
  f[0][3] = 462063756;
  f[0][2] = 768209115;
  f[0][1] = 482164403;
  f[0][0] = 642497124;
  f[1][256] = 51933421;
  f[1][255] = 410403148;
  f[1][254] = 334527774;
  f[1][253] = 772784623;
  f[1][252] = 616557739;
  f[1][251] = 119956662;
  f[1][250] = 238586775;
  f[1][249] = 63611061;
  f[1][248] = 336008070;
  f[1][247] = 669986155;
  f[1][246] = 113924623;
  f[1][245] = 290147622;
  f[1][244] = 396846646;
  f[1][243] = 112511021;
  f[1][242] = 506832921;
  f[1][241] = 18685233;
  f[1][240] = 505761984;
  f[1][239] = 225925875;
  f[1][238] = 457760646;
  f[1][237] = 658656684;
  f[1][236] = 195193908;
  f[1][235] = 757727334;
  f[1][234] = 640171035;
  f[1][233] = 277206615;
  f[1][232] = 551718468;
  f[1][231] = 545555745;
  f[1][230] = 681825249;
  f[1][229] = 115612245;
  f[1][228] = 685740951;
  f[1][227] = 231158277;
  f[1][226] = 622498779;
  f[1][225] = 374707494;
  f[1][224] = 691786683;
  f[1][223] = 666008595;
  f[1][222] = 585462906;
  f[1][221] = 146037150;
  f[1][220] = 466218648;
  f[1][219] = 547014447;
  f[1][218] = 290039148;
  f[1][217] = 190245195;
  f[1][216] = 363920382;
  f[1][215] = 156455586;
  f[1][214] = 278403867;
  f[1][213] = 327398400;
  f[1][212] = 586278000;
  f[1][211] = 393846327;
  f[1][210] = 543672234;
  f[1][209] = 561963717;
  f[1][208] = 580966092;
  f[1][207] = 753823584;
  f[1][206] = 130668327;
  f[1][205] = 353120823;
  f[1][204] = 249229170;
  f[1][203] = 166684527;
  f[1][202] = 751104774;
  f[1][201] = 309569589;
  f[1][200] = 415359657;
  f[1][199] = 723936555;
  f[1][198] = 583194366;
  f[1][197] = 494437752;
  f[1][196] = 518796945;
  f[1][195] = 39580443;
  f[1][194] = 776201013;
  f[1][193] = 42414435;
  f[1][192] = 612152037;
  f[1][191] = 608226003;
  f[1][190] = 99972432;
  f[1][189] = 558262341;
  f[1][188] = 106017282;
  f[1][187] = 690040638;
  f[1][186] = 28879011;
  f[1][185] = 512108856;
  f[1][184] = 337388940;
  f[1][183] = 551043738;
  f[1][182] = 450089262;
  f[1][181] = 360676008;
  f[1][180] = 402578568;
  f[1][179] = 120337812;
  f[1][178] = 519804558;
  f[1][177] = 324290610;
  f[1][176] = 23385663;
  f[1][175] = 225772848;
  f[1][174] = 745389414;
  f[1][173] = 233672418;
  f[1][172] = 19259856;
  f[1][171] = 276174402;
  f[1][170] = 744786693;
  f[1][169] = 375112647;
  f[1][168] = 758102058;
  f[1][167] = 444609585;
  f[1][166] = 510907446;
  f[1][165] = 172560633;
  f[1][164] = 142626330;
  f[1][163] = 429471231;
  f[1][162] = 211245489;
  f[1][161] = 577291428;
  f[1][160] = 91991781;
  f[1][159] = 9088632;
  f[1][158] = 259025598;
  f[1][157] = 596818971;
  f[1][156] = 43978329;
  f[1][155] = 157324491;
  f[1][154] = 3103092;
  f[1][153] = 462674016;
  f[1][152] = 627500097;
  f[1][151] = 512182818;
  f[1][150] = 338032656;
  f[1][149] = 603489402;
  f[1][148] = 54829908;
  f[1][147] = 501181650;
  f[1][146] = 736006257;
  f[1][145] = 286368453;
  f[1][144] = 389728458;
  f[1][143] = 40215357;
  f[1][142] = 534475872;
  f[1][141] = 64943298;
  f[1][140] = 112310856;
  f[1][139] = 682966116;
  f[1][138] = 69045921;
  f[1][137] = 439587099;
  f[1][136] = 469819224;
  f[1][135] = 695798271;
  f[1][134] = 38780154;
  f[1][133] = 396695565;
  f[1][132] = 631539342;
  f[1][131] = 88089750;
  f[1][130] = 632887668;
  f[1][129] = 56238084;
  f[1][128] = 569195676;
  f[1][127] = 708023862;
  f[1][126] = 80301375;
  f[1][125] = 1768977;
  f[1][124] = 434685258;
  f[1][123] = 475528473;
  f[1][122] = 421403409;
  f[1][121] = 775975599;
  f[1][120] = 511142751;
  f[1][119] = 131177718;
  f[1][118] = 748118511;
  f[1][117] = 296645895;
  f[1][116] = 110110707;
  f[1][115] = 639416484;
  f[1][114] = 194905872;
  f[1][113] = 211085469;
  f[1][112] = 309238398;
  f[1][111] = 11740617;
  f[1][110] = 693768537;
  f[1][109] = 652625388;
  f[1][108] = 324264456;
  f[1][107] = 640051812;
  f[1][106] = 584206074;
  f[1][105] = 361094166;
  f[1][104] = 224922159;
  f[1][103] = 89967528;
  f[1][102] = 349541550;
  f[1][101] = 591638112;
  f[1][100] = 410970006;
  f[1][99] = 291661029;
  f[1][98] = 15985323;
  f[1][97] = 613778508;
  f[1][96] = 65323503;
  f[1][95] = 341231688;
  f[1][94] = 468358191;
  f[1][93] = 521572968;
  f[1][92] = 361541124;
  f[1][91] = 429215724;
  f[1][90] = 127304142;
  f[1][89] = 228266073;
  f[1][88] = 11703825;
  f[1][87] = 304947090;
  f[1][86] = 589390074;
  f[1][85] = 128418948;
  f[1][84] = 3862068;
  f[1][83] = 377654949;
  f[1][82] = 714128667;
  f[1][81] = 456248898;
  f[1][80] = 147611205;
  f[1][79] = 5728464;
  f[1][78] = 21997836;
  f[1][77] = 396817281;
  f[1][76] = 734158215;
  f[1][75] = 341780733;
  f[1][74] = 747135963;
  f[1][73] = 339589404;
  f[1][72] = 417125457;
  f[1][71] = 44524053;
  f[1][70] = 339589656;
  f[1][69] = 681789969;
  f[1][68] = 494463186;
  f[1][67] = 220301928;
  f[1][66] = 453528621;
  f[1][65] = 517248963;
  f[1][64] = 675326610;
  f[1][63] = 507964023;
  f[1][62] = 351220905;
  f[1][61] = 574648641;
  f[1][60] = 689828796;
  f[1][59] = 695091546;
  f[1][58] = 465336054;
  f[1][57] = 429224274;
  f[1][56] = 405628839;
  f[1][55] = 696994956;
  f[1][54] = 611296308;
  f[1][53] = 357242229;
  f[1][52] = 176520078;
  f[1][51] = 721298331;
  f[1][50] = 127701891;
  f[1][49] = 117572859;
  f[1][48] = 511306362;
  f[1][47] = 452641455;
  f[1][46] = 771641703;
  f[1][45] = 283264821;
  f[1][44] = 443032569;
  f[1][43] = 441456687;
  f[1][42] = 139696515;
  f[1][41] = 627111387;
  f[1][40] = 665791056;
  f[1][39] = 388047555;
  f[1][38] = 332840025;
  f[1][37] = 259736526;
  f[1][36] = 473910948;
  f[1][35] = 191720088;
  f[1][34] = 102052314;
  f[1][33] = 654363234;
  f[1][32] = 399056049;
  f[1][31] = 496688157;
  f[1][30] = 691964847;
  f[1][29] = 654378921;
  f[1][28] = 766395126;
  f[1][27] = 111085128;
  f[1][26] = 722623041;
  f[1][25] = 492109128;
  f[1][24] = 523195911;
  f[1][23] = 645447222;
  f[1][22] = 614109258;
  f[1][21] = 706116537;
  f[1][20] = 242583957;
  f[1][19] = 533025234;
  f[1][18] = 553627998;
  f[1][17] = 488329191;
  f[1][16] = 743539734;
  f[1][15] = 315527373;
  f[1][14] = 490300965;
  f[1][13] = 715317967;
  f[1][12] = 493725043;
  f[1][11] = 228877044;
  f[1][10] = 317300809;
  f[1][9] = 663739304;
  f[1][8] = 80515854;
  f[1][7] = 396414708;
  f[1][6] = 317067177;
  f[1][5] = 102404925;
  f[1][4] = 289303402;
  f[1][3] = 139952108;
  f[1][2] = 386543325;
  f[1][1] = 412133651;
  f[1][0] = 507720408;
  scanf("%d%d", &n, &k);
  if (n <= 64)
    printf("%lld", g[n][n - k][k]);
  else
    printf("%lld", f[2 - 256 / n][k]);
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

There are n people, sitting in a line at the table. For each person we know that he always tells either the truth or lies.

Little Serge asked them: how many of you always tell the truth? Each of the people at the table knows everything (who is an honest person and who is a liar) about all the people at the table. The honest people are going to say the correct answer, the liars are going to say any integer from 1 to n, which is not the correct answer. Every liar chooses his answer, regardless of the other liars, so two distinct liars may give distinct answer.

Serge does not know any information about the people besides their answers to his question. He took a piece of paper and wrote n integers a1, a2, ..., an, where ai is the answer of the i-th person in the row. Given this sequence, Serge determined that exactly k people sitting at the table apparently lie.

Serge wonders, how many variants of people's answers (sequences of answers a of length n) there are where one can say that exactly k people sitting at the table apparently lie. As there can be rather many described variants of answers, count the remainder of dividing the number of the variants by 777777777.

Input

The first line contains two integers n, k, (1 ≤ k ≤ n ≤ 28). It is guaranteed that n — is the power of number 2.

Output

Print a single integer — the answer to the problem modulo 777777777.

Examples

Input

1 1


Output

0


Input

2 1


Output

2

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int n, k;
long long c[310][310], g[310][310][310], f[2][310];
int main() {
  c[0][0] = 1;
  for (int i = 1; i <= 64; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 777777777;
  }
  g[0][0][0] = 1;
  for (int i = 1; i <= 64; ++i) {
    memcpy(g[i], g[i - 1], sizeof(g[i - 1]));
    for (int p = 1; p <= 64; ++p)
      if (p == i) {
        for (int j = p; j <= 64; ++j)
          for (int k = 0; j + k <= 64; ++k)
            g[i][j][k] =
                (g[i][j][k] + g[i - 1][j - p][k] * c[j + k][p]) % 777777777;
      } else {
        for (int j = 0; j <= 64; ++j)
          for (int k = p; j + k <= 64; ++k)
            g[i][j][k] =
                (g[i][j][k] + g[i - 1][j][k - p] * c[j + k][p]) % 777777777;
      }
  }
  f[0][128] = 149150650;
  f[0][127] = 232966794;
  f[0][126] = 487159055;
  f[0][125] = 30540300;
  f[0][124] = 458170419;
  f[0][123] = 480722613;
  f[0][122] = 605295159;
  f[0][121] = 37220268;
  f[0][120] = 292922628;
  f[0][119] = 530767740;
  f[0][118] = 138718678;
  f[0][117] = 257373347;
  f[0][116] = 44594256;
  f[0][115] = 340129188;
  f[0][114] = 610216692;
  f[0][113] = 416259390;
  f[0][112] = 657133515;
  f[0][111] = 479433192;
  f[0][110] = 317959019;
  f[0][109] = 500636381;
  f[0][108] = 12787348;
  f[0][107] = 669954708;
  f[0][106] = 68131467;
  f[0][105] = 526429710;
  f[0][104] = 423048528;
  f[0][103] = 254706039;
  f[0][102] = 42951006;
  f[0][101] = 282387700;
  f[0][100] = 303717460;
  f[0][99] = 341834527;
  f[0][98] = 333633477;
  f[0][97] = 65589678;
  f[0][96] = 376367145;
  f[0][95] = 4802637;
  f[0][94] = 415705878;
  f[0][93] = 352406796;
  f[0][92] = 72018835;
  f[0][91] = 52410890;
  f[0][90] = 241289776;
  f[0][89] = 343900011;
  f[0][88] = 624827616;
  f[0][87] = 353784942;
  f[0][86] = 615036450;
  f[0][85] = 508213986;
  f[0][84] = 138765186;
  f[0][83] = 668528077;
  f[0][82] = 437011960;
  f[0][81] = 710035809;
  f[0][80] = 735862995;
  f[0][79] = 676063665;
  f[0][78] = 294926121;
  f[0][77] = 565603164;
  f[0][76] = 111746817;
  f[0][75] = 335375775;
  f[0][74] = 27702486;
  f[0][73] = 299270097;
  f[0][72] = 434962491;
  f[0][71] = 501639192;
  f[0][70] = 286484229;
  f[0][69] = 578826927;
  f[0][68] = 685038942;
  f[0][67] = 700348950;
  f[0][66] = 654339672;
  f[0][65] = 143420103;
  f[0][64] = 104733162;
  f[0][63] = 590145264;
  f[0][62] = 371892402;
  f[0][61] = 506813013;
  f[0][60] = 596108961;
  f[0][59] = 533997135;
  f[0][58] = 244690731;
  f[0][57] = 261388683;
  f[0][56] = 663532359;
  f[0][55] = 429824745;
  f[0][54] = 435828036;
  f[0][53] = 705296781;
  f[0][52] = 474743430;
  f[0][51] = 427694175;
  f[0][50] = 346831137;
  f[0][49] = 54648783;
  f[0][48] = 310453920;
  f[0][47] = 465470131;
  f[0][46] = 33785059;
  f[0][45] = 738490312;
  f[0][44] = 39521181;
  f[0][43] = 671903001;
  f[0][42] = 487033953;
  f[0][41] = 685013007;
  f[0][40] = 478908360;
  f[0][39] = 93337440;
  f[0][38] = 208947235;
  f[0][37] = 407997044;
  f[0][36] = 591219559;
  f[0][35] = 594676173;
  f[0][34] = 777331779;
  f[0][33] = 387099846;
  f[0][32] = 265613565;
  f[0][31] = 739707108;
  f[0][30] = 95984586;
  f[0][29] = 500815609;
  f[0][28] = 703097347;
  f[0][27] = 561797418;
  f[0][26] = 495032139;
  f[0][25] = 705610017;
  f[0][24] = 137170026;
  f[0][23] = 676047609;
  f[0][22] = 498253248;
  f[0][21] = 750976272;
  f[0][20] = 124604900;
  f[0][19] = 756201264;
  f[0][18] = 517628076;
  f[0][17] = 773939082;
  f[0][16] = 652682670;
  f[0][15] = 55761813;
  f[0][14] = 671961765;
  f[0][13] = 168908523;
  f[0][12] = 243630450;
  f[0][11] = 175889805;
  f[0][10] = 231881111;
  f[0][9] = 478771358;
  f[0][8] = 621882744;
  f[0][7] = 678182556;
  f[0][6] = 341766705;
  f[0][5] = 36099042;
  f[0][4] = 154906374;
  f[0][3] = 462063756;
  f[0][2] = 768209115;
  f[0][1] = 482164403;
  f[0][0] = 642497124;
  f[1][256] = 51933421;
  f[1][255] = 410403148;
  f[1][254] = 334527774;
  f[1][253] = 772784623;
  f[1][252] = 616557739;
  f[1][251] = 119956662;
  f[1][250] = 238586775;
  f[1][249] = 63611061;
  f[1][248] = 336008070;
  f[1][247] = 669986155;
  f[1][246] = 113924623;
  f[1][245] = 290147622;
  f[1][244] = 396846646;
  f[1][243] = 112511021;
  f[1][242] = 506832921;
  f[1][241] = 18685233;
  f[1][240] = 505761984;
  f[1][239] = 225925875;
  f[1][238] = 457760646;
  f[1][237] = 658656684;
  f[1][236] = 195193908;
  f[1][235] = 757727334;
  f[1][234] = 640171035;
  f[1][233] = 277206615;
  f[1][232] = 551718468;
  f[1][231] = 545555745;
  f[1][230] = 681825249;
  f[1][229] = 115612245;
  f[1][228] = 685740951;
  f[1][227] = 231158277;
  f[1][226] = 622498779;
  f[1][225] = 374707494;
  f[1][224] = 691786683;
  f[1][223] = 666008595;
  f[1][222] = 585462906;
  f[1][221] = 146037150;
  f[1][220] = 466218648;
  f[1][219] = 547014447;
  f[1][218] = 290039148;
  f[1][217] = 190245195;
  f[1][216] = 363920382;
  f[1][215] = 156455586;
  f[1][214] = 278403867;
  f[1][213] = 327398400;
  f[1][212] = 586278000;
  f[1][211] = 393846327;
  f[1][210] = 543672234;
  f[1][209] = 561963717;
  f[1][208] = 580966092;
  f[1][207] = 753823584;
  f[1][206] = 130668327;
  f[1][205] = 353120823;
  f[1][204] = 249229170;
  f[1][203] = 166684527;
  f[1][202] = 751104774;
  f[1][201] = 309569589;
  f[1][200] = 415359657;
  f[1][199] = 723936555;
  f[1][198] = 583194366;
  f[1][197] = 494437752;
  f[1][196] = 518796945;
  f[1][195] = 39580443;
  f[1][194] = 776201013;
  f[1][193] = 42414435;
  f[1][192] = 612152037;
  f[1][191] = 608226003;
  f[1][190] = 99972432;
  f[1][189] = 558262341;
  f[1][188] = 106017282;
  f[1][187] = 690040638;
  f[1][186] = 28879011;
  f[1][185] = 512108856;
  f[1][184] = 337388940;
  f[1][183] = 551043738;
  f[1][182] = 450089262;
  f[1][181] = 360676008;
  f[1][180] = 402578568;
  f[1][179] = 120337812;
  f[1][178] = 519804558;
  f[1][177] = 324290610;
  f[1][176] = 23385663;
  f[1][175] = 225772848;
  f[1][174] = 745389414;
  f[1][173] = 233672418;
  f[1][172] = 19259856;
  f[1][171] = 276174402;
  f[1][170] = 744786693;
  f[1][169] = 375112647;
  f[1][168] = 758102058;
  f[1][167] = 444609585;
  f[1][166] = 510907446;
  f[1][165] = 172560633;
  f[1][164] = 142626330;
  f[1][163] = 429471231;
  f[1][162] = 211245489;
  f[1][161] = 577291428;
  f[1][160] = 91991781;
  f[1][159] = 9088632;
  f[1][158] = 259025598;
  f[1][157] = 596818971;
  f[1][156] = 43978329;
  f[1][155] = 157324491;
  f[1][154] = 3103092;
  f[1][153] = 462674016;
  f[1][152] = 627500097;
  f[1][151] = 512182818;
  f[1][150] = 338032656;
  f[1][149] = 603489402;
  f[1][148] = 54829908;
  f[1][147] = 501181650;
  f[1][146] = 736006257;
  f[1][145] = 286368453;
  f[1][144] = 389728458;
  f[1][143] = 40215357;
  f[1][142] = 534475872;
  f[1][141] = 64943298;
  f[1][140] = 112310856;
  f[1][139] = 682966116;
  f[1][138] = 69045921;
  f[1][137] = 439587099;
  f[1][136] = 469819224;
  f[1][135] = 695798271;
  f[1][134] = 38780154;
  f[1][133] = 396695565;
  f[1][132] = 631539342;
  f[1][131] = 88089750;
  f[1][130] = 632887668;
  f[1][129] = 56238084;
  f[1][128] = 569195676;
  f[1][127] = 708023862;
  f[1][126] = 80301375;
  f[1][125] = 1768977;
  f[1][124] = 434685258;
  f[1][123] = 475528473;
  f[1][122] = 421403409;
  f[1][121] = 775975599;
  f[1][120] = 511142751;
  f[1][119] = 131177718;
  f[1][118] = 748118511;
  f[1][117] = 296645895;
  f[1][116] = 110110707;
  f[1][115] = 639416484;
  f[1][114] = 194905872;
  f[1][113] = 211085469;
  f[1][112] = 309238398;
  f[1][111] = 11740617;
  f[1][110] = 693768537;
  f[1][109] = 652625388;
  f[1][108] = 324264456;
  f[1][107] = 640051812;
  f[1][106] = 584206074;
  f[1][105] = 361094166;
  f[1][104] = 224922159;
  f[1][103] = 89967528;
  f[1][102] = 349541550;
  f[1][101] = 591638112;
  f[1][100] = 410970006;
  f[1][99] = 291661029;
  f[1][98] = 15985323;
  f[1][97] = 613778508;
  f[1][96] = 65323503;
  f[1][95] = 341231688;
  f[1][94] = 468358191;
  f[1][93] = 521572968;
  f[1][92] = 361541124;
  f[1][91] = 429215724;
  f[1][90] = 127304142;
  f[1][89] = 228266073;
  f[1][88] = 11703825;
  f[1][87] = 304947090;
  f[1][86] = 589390074;
  f[1][85] = 128418948;
  f[1][84] = 3862068;
  f[1][83] = 377654949;
  f[1][82] = 714128667;
  f[1][81] = 456248898;
  f[1][80] = 147611205;
  f[1][79] = 5728464;
  f[1][78] = 21997836;
  f[1][77] = 396817281;
  f[1][76] = 734158215;
  f[1][75] = 341780733;
  f[1][74] = 747135963;
  f[1][73] = 339589404;
  f[1][72] = 417125457;
  f[1][71] = 44524053;
  f[1][70] = 339589656;
  f[1][69] = 681789969;
  f[1][68] = 494463186;
  f[1][67] = 220301928;
  f[1][66] = 453528621;
  f[1][65] = 517248963;
  f[1][64] = 675326610;
  f[1][63] = 507964023;
  f[1][62] = 351220905;
  f[1][61] = 574648641;
  f[1][60] = 689828796;
  f[1][59] = 695091546;
  f[1][58] = 465336054;
  f[1][57] = 429224274;
  f[1][56] = 405628839;
  f[1][55] = 696994956;
  f[1][54] = 611296308;
  f[1][53] = 357242229;
  f[1][52] = 176520078;
  f[1][51] = 721298331;
  f[1][50] = 127701891;
  f[1][49] = 117572859;
  f[1][48] = 511306362;
  f[1][47] = 452641455;
  f[1][46] = 771641703;
  f[1][45] = 283264821;
  f[1][44] = 443032569;
  f[1][43] = 441456687;
  f[1][42] = 139696515;
  f[1][41] = 627111387;
  f[1][40] = 665791056;
  f[1][39] = 388047555;
  f[1][38] = 332840025;
  f[1][37] = 259736526;
  f[1][36] = 473910948;
  f[1][35] = 191720088;
  f[1][34] = 102052314;
  f[1][33] = 654363234;
  f[1][32] = 399056049;
  f[1][31] = 496688157;
  f[1][30] = 691964847;
  f[1][29] = 654378921;
  f[1][28] = 766395126;
  f[1][27] = 111085128;
  f[1][26] = 722623041;
  f[1][25] = 492109128;
  f[1][24] = 523195911;
  f[1][23] = 645447222;
  f[1][22] = 614109258;
  f[1][21] = 706116537;
  f[1][20] = 242583957;
  f[1][19] = 533025234;
  f[1][18] = 553627998;
  f[1][17] = 488329191;
  f[1][16] = 743539734;
  f[1][15] = 315527373;
  f[1][14] = 490300965;
  f[1][13] = 715317967;
  f[1][12] = 493725043;
  f[1][11] = 228877044;
  f[1][10] = 317300809;
  f[1][9] = 663739304;
  f[1][8] = 80515854;
  f[1][7] = 396414708;
  f[1][6] = 317067177;
  f[1][5] = 102404925;
  f[1][4] = 289303402;
  f[1][3] = 139952108;
  f[1][2] = 386543325;
  f[1][1] = 412133651;
  f[1][0] = 507720408;
  scanf("%d%d", &n, &k);
  if (n <= 64)
    printf("%lld", g[n][n - k][k]);
  else
    printf("%lld", f[2 - 256 / n][k]);
  return 0;
}

```