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