const
  infile = '';
  outfile = '';

  maxn = 100;
  maxd = 1020847;
  modd = 100000000;

var
  f : text;

  cur, res, n, p, k : longint;

  used : array[0..2000] of boolean;
  comb : array[0..2000] of word;

  r, r2 : array[0..maxn, 0..maxn] of qword;

procedure input;
begin
  assign(f, infile);
  reset(f);
  readln(f, n, p);
  close(f);
end;

procedure solve;
var
  nn, pp, x, k, i, j : longint;
begin
  r[1, 1]:=1;
  r2[1, 1]:=1;
  for nn:=2 to n do
  begin
    for pp:=2 to nn do
    begin
      for x:=1 to nn do
      begin
        r2[pp, x]:=0;
        for k:=1 to x-1 do
        begin
          inc(r2[pp, x], r[pp-1, k]);
          if r2[pp, x] >= maxd then r2[pp, x]:=r2[pp, x] mod modd;
        end;
        for k:=x to nn-1 do
        begin
          inc(r2[pp, x], r[pp, k]);
          if r2[pp, x] >= maxd then r2[pp, x]:=r2[pp, x] mod modd;
        end;
      end;
    end;
    r:=r2;
{
    for j:=1 to nn do
    begin
      for i:=1 to nn do write(r[j, i], ' ');
      writeln;
    end;
    readln;
}
  end;
end;

procedure output;
begin
  assign(f, outfile);
  rewrite(f);

  if (p<>1)and(p<>n) then
  begin
    if (p=2) or (p=(n-1)) then
    begin
      res:=1;
      for k:=2 to n-1 do res:=(res*2 + k) mod modd;
    end
    else
      begin
        solve;
        for k:=1 to n do
        begin
          res:=res+r[p, k];
          if res > maxd then res:=res mod modd;
        end;

        res:=res mod maxd;
      end;
  end
  else res:=1;

  writeln(res mod maxd);
  close(f);
end;

begin
  input;
  output;
end.
