const maxn = 50; maxci=15;
type chis = array[0..maxci]of byte;

var a : array[1..maxn,1..maxn]of chis;
    mm,ll : chis;
    i,j,k,n,m,p,yes,co : longint;

Procedure nul(var v : chis);
var tt,yy : longint;
begin
  for yy:=1 to maxci do v[yy]:=0;
  v[0]:=1;
end;

Procedure sb(var s1 : chis; s2 : chis);
var br1,br2,x,max,cqlo,ost : longint;
    otg : chis;
begin
  nul(otg);
  br1:=s1[0];
  br2:=s2[0];
  if br1>br2 then max:=br1
  else max:=br2;
  ost:=0;
  for x:=1 to max do begin
    cqlo:=s1[x]+s2[x]+ost;
    otg[x]:=cqlo mod 10;
    ost:=cqlo div 10;
  end;
  otg[0]:=max;
  if ost=1 then begin inc(otg[0]); otg[otg[0]]:=1; end;
  s1:=otg;
end;

Procedure umn(var s1 : chis;v : integer);
var aq : longint;
    we : chis;
begin
  nul(we);
  for aq:=1 to v do sb(we,s1);
  s1:=we;
end;

Procedure del(var s1 : chis);
var da,cqlo,ost : longint;
    p  :chis;
begin
  m:=s1[0];
  nul(p);
  for i:=1 to m do p[i]:=s1[m-i+1];
  p[0]:=m;
  i:=0;da:=0;
  repeat
    inc(i);
    da:=da*10+p[i];
  until (da>co)or(i=m);
  ost:=da mod co;
  if i<m then
    repeat
      inc(i);
      ost:=ost*10+p[i];
      if ost>co then ost:=ost mod co;
    until i=m;
  yes:=ost;
end;

begin
  readln(n,p);
  for i:=1 to n do begin a[i,1,0]:=1;a[i,1,1]:=1;
                         a[i,i,0]:=1;a[i,i,1]:=1;
                   end;
  for i:=3 to n do
    for j:=2 to i-1 do begin
      nul(mm);
      for k:=1 to j do sb(mm,a[i-1,j]);
      for k:=1 to i-j+1 do sb(mm,a[i-1,j-1]);
      a[i,j]:=mm;
    end;
  ll:=a[n,p];
  co:=1020847;
  del(ll);
  writeln(yes);
end.