Your task is to calculate the number of arrays such that:  each array contains $$$n$$$ elements;  each element is an integer from $$$1$$$ to $$$m$$$;  for each array, there is exactly one pair of equal elements;  for each array $$$a$$$, there exists an index $$$i$$$ such that the array is strictly ascending before the $$$i$$$-th element and strictly descending after it (formally, it means that $$$a_j < a_{j + 1}$$$, if $$$j < i$$$, and $$$a_j > a_{j + 1}$$$, if $$$j \ge i$$$).

The first line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \le n \le m \le 2 \cdot 10^5$$$).

Print one integer — the number of arrays that meet all of the aforementioned conditions, taken modulo $$$998244353$$$.

         uses strutils;
          const eps=1e-14;
          besk=20000000000000000; label 4,1,3,2,44,22;
          type mas=array[-1000000..1400000+1] of int64;
          integer=longint;     zap=record  x,y,z:int64; end;
           zap1=^zap;
            var pos,ii,qqq,oldpos,jj,kolvzv,sdvig,dl,i1,j1,mask,stepp,n2,i,j,k,l,step,k1,mesto:longint;
           oldss,smin,ss3,ss,ss1,ss2:string;
           aans:zap;
           pqqq:zap;  bet,al:extended; fl1,fl2,fl:boolean;
           drans,dr3,dr1,dr2,pt,ott1,ott2:zap;
          ver:array[-1..500,-1..5] of extended;
           verugad:array[-2..200,-2..200,-2..200] of extended;
          nomer,nap,ot,stepen,delit,pq,pp1,pp2,period, dolg,ot1,ot2,oldgr,predsum,pmin,tmin,aa,bb,kool,sum,number,imin,kolreber,kolstan,qq,kol,chisl,znam,n,m,ttt,numpos,vx,vy,ans,up,down,ymin,ymax,imax,t3,qq1,qq2,q1,q2,ost,koll,w,dx,dy,time,p3,p4,qqqq,tt,pmax,pmax2,p1,p2,ott,hh,pos0,pos1,pos2,pp,mm,maxot,tmax,nn,kk,modul,t0,n1,q,t,p:int64; flag1:boolean;
          zzz,fact,z,stan,a2,invx,invy,summ,place,str,b2,z1,sum1,sum0,d0,d1,ccc,c,d,a,b:mas; flag2,flag:boolean;  pl:longint;
          oldmax,newmax,posmax,zapas,razn,oldll,oldrr,ppp,shag,posx,posy,minx,miny,maxx,maxy,kolplus,kolminus,razr,jmax,gr,grr,ener,dob,cc,dist,tt3,tt1,tt2,ugg,aa1,aa2,r,ug:int64;
          zan2,zan1,prost,marked,zan:array[-1000000..1000000] of boolean;
           num,start,finish,left,right,zz,ll,rr,path,lx,a3,a4,predok,a1,b1:array[-1000000..1500000] of int64;
           ppole1,ppole2,ppole:array[-1000000..3000000] of char;
          bufer, str1,str2,stroka:array[-1000..1000000] of char;
         dinam:array[-100000..1000000] of extended;
         t1,t2,al1,bet1,cosa,sina,cosb,sinb,rx,ry,sdvigx,sdvigy,px,py,h1,h2,h,l1,l2,otmax,v:int64;
          dddd,ssumitog,profil:array[-100..110,-100..110,-100..110] of int64;
          sss1,sss2,sp,sss:array[-10..1100005] of string;
          newpole,pole:array[-1..2100,-1..2700] of char;
          verch,verzn:array[-10..1100000] of int64;
          dd1,dd2,ddinv:array[-1..110000,-1..30] of int64;
          dd:array[-1..100001,0..128] of int64;
          poss:int64;
          obmen,ch:char;

          ff,flagg1:boolean;
          oldx,oldy,numx,numy,xleft,xright,s,znach,newplace,newstr,next,prev,xx,yy,aold,x,y:array[-10000..1700002] of int64;
          dp:array[0..3,-1..910,0..12] of int64;
           function srav(i,j:longint):boolean; label 44;
                begin
                 if (a[i]<a[j]) then begin srav:=true; goto 44;  end;
                if a[i]>a[j] then begin  srav:=false; goto 44;   end;
                 if a[i]=a[j] then if a1[i]<a1[j] then srav:=true else srav:=false;
                     44:
                end;

              procedure sl (k,l,m:integer);  {k- dlina, l,m - nachalo dvuh blokov}
                 begin
                i:=l;j:=m; flag:=true; step:=0;while flag do begin
               if (srav(i,j)) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];end;
                inc(step);inc(i);
                {writeln('step=',step,' i=',i);} end;
               if (not srav(i,j)) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];end;
               inc(step);inc(j);end;
               if  ((i>=l+k) or (j>=m+k)) then flag:=false;
                  end;
                   if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];inc(step);inc(j);until (j>=m+k);
                    if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];inc(step);inc(i);until (i>=l+k);
                   end;
             procedure sort(var c:mas);
                    begin

                       k:=1; repeat
                       l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
                      for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i];a2[i]:=b2[i]; end;
                         until (k>=n);

                      end;

             function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
             function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

        {   function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
           tt:zap; tt1:zap1;  fl:boolean;
        begin
           fl:=false;
           if a<b then begin r:=a;a:=b;b:=r; fl:=true; end;
           x2:=1;x1:=0;y2:=0;y1:=1;
           while b>0 do
              begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
                   a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
              end;
            if not fl then begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt; end else
                     begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=y;tt.p3:=x; tt1:=@tt; end;
                  evkl:=tt1;
        end;

         }
     function phi(a,b:double):double; label 222;var p:double;
       begin
        if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
        if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
        if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
        if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
        if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
        222: phi:=p;
      end;

  function nod(a,b:int64):int64; var p,t:int64;
     begin
         a:=abs(a); b:=abs(b);
         if (a>0)and(b>0) then
         begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
          p:=a;
          end else if a=0 then p:=b else p:=a;
         nod:=p;
     end;
      function arccos(tt:extended):extended;
         begin
          if abs(tt)>1-1e-13 then
          if tt>0 then  arccos:=0 else arccos:=pi;
          if tt=0 then arccos:=pi/2 else
          if abs(tt)<=1-1e-13 then if tt>=0 then arccos:=arctan(sqrt(1-tt*tt)/tt)
          else arccos:=pi+arctan(sqrt(1-tt*tt)/tt);

         end;

              function nok(a,b:int64):int64;
               begin  nok:=(a*b) div nod(a,b);  end;

             function degg(a:int64;k:int64):int64; var p:int64;    label 4;
                  begin
                   if k<=0 then degg:=1
                   else if odd(k) then degg:=(degg(a,k-1)*a) mod modul  else
                     begin  p:=degg(a,k div 2);  degg:=(p*p) mod modul;    end;

                 end;

             function zaprmax(left,right:longint):int64;
                begin
                      if left>=right then zaprmax:=y[left] else
                 begin
                  if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
                      begin
                      if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
                      if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);
                      end;

                  end;

                 end;

              function zaprmin(left,right:longint):int64;
                begin
                if left>=right then zaprmin:=y[left] else
                   begin
                 if not odd(left) and odd(right) then zaprmin:=zaprmin(left shr 1,right shr 1) else
                    begin
                     if odd(left) then  zaprmin:=min(zaprmin(left+1,right),y[left]);
                     if not odd(right) then zaprmin:=min(zaprmin(left,right-1),y[right]);
                     end;
                   end;

                                end;

      procedure udal(ii:longint);
   begin  next[prev[ii]]:=next[ii];prev[next[ii]]:=prev[ii];  end;

           function nomerr(gr:int64):int64;
            var ot,aa,bb,cc:int64; fl:boolean;
                 begin
                aa:=1; bb:=p;  cc:=aa; fl:=false;
                  while abs(aa-bb)>1 do
                     begin
                       cc:=(aa+bb) shr 1;
                        writeln('cc=++ ',cc);
                      if y[cc]<gr then aa:=cc else bb:=cc;

                     end;
                      writeln(' cc= ',cc);
                   {  cc:=max(cc-3,0);
                       }  repeat inc(cc) until y[cc]>=gr;
                          if y[cc]=gr then fl:=true else fl:=false;
                          if fl then nomerr:=a1[cc] else nomerr:=-1000;
                           nomerr:=cc;
                 end;

           function pprost(pp:int64):boolean;
            var i,j,t:longint; tt:extended; fl:boolean;
               begin
               tt:=pp;
               tt:=sqrt(tt);
               fl:=true;
               for i:=2 to round(tt) do if pp mod i=0 then  fl:=false;
               pprost:=fl;
               end;

           function gl(c:char):boolean;
                  begin
              if (c='a')or (c='o')or(c='e')or(c='i')or(c='u') then gl:=true else gl:=false;
                  end;

    function slog(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.y+d1.y*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        slog:=@ans;
    end;

    function umn(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        umn:=@ans;
    end;

  function bincoef(ii,jj:longint):int64;
var t1,t2,t3,p1,p2,p3,ot:int64;
begin
  p1:=fact[ii];
  p2:=fact[jj];
  p3:=fact[ii-jj];
  t2:=degg(p2,modul-2);
  t3:=degg(p3,modul-2);
  ot:=((p1*t2) mod modul*t3) mod modul;
  bincoef:=ot;
end;

    begin
   {  assign (input,'D:\Projects\input.txt');reset(input);
     assign (output,'D:\Projects\output.txt'); rewrite(output);
    }
     modul:=998244353;
     readln(n,m);
     fact[0]:=1;
     for i:=1 to 500000 do fact[i]:=(fact[i-1]*i) mod modul;

    { for i:=-10 to 10 do writeln(i,' ',bincoef(100000,i));
     }

    ot:=0;
  {  for i:=2 to ((n+1) div 2) do
      begin
        ot:=(ot+(bincoef(n-2,i-2)) mod modul) mod modul;

      end;
   }  { ot:=ot*2 mod modul;
      }
     { writeln('ot= ',ot);
      }
     pp:=(bincoef(m,n-1)*(n-2)) mod modul;
    { writeln('mnog= ',pp);
     }
     writeln(pp*degg(2,n-3) mod modul);
     ot:=(ot*pp) mod modul;
    { ot:=ot*degg(2,modul-2) mod modul;
     }

    goto 1;
    writeln('-----------');
  pp:=1;
  for i:=1 to n do pp:=pp*m;
  aa:=0;
 for mask:=0 to pp-1 do
   begin
      tt:=mask; flag:=true;
      for i:=1 to m do
        begin
           x[i]:=tt mod m+1;
           tt:=tt div m;

        end;
   {   writeln('mask= ',mask);
     for i:=1 to n do write(x[i],' '); writeln;
   }  flag:=true;
     for i:=0 to n+m do z[i]:=0;
     for i:=1 to n do inc(z[x[i]]);
   {  for i:=0 to n+m do if z[i]>1 then flag:=false;
     writeln(flag);
   }  bb:=0;
     for i:=1 to n do for j:=i+1 to n do if x[i]=x[j] then inc(bb);
     if bb<>1 then flag:=false;
     tmax:=0;
     for i:=1 to n do if x[i]>tmax then begin tmax:=x[i]; imax:=i;   end;
    { writeln('imax= ',imax);
    } for i:=1 to imax-1 do if x[i]>=x[i+1] then flag:=false;
     for i:=imax to n-1 do if x[i]<=x[i+1] then flag:=false;
    { writeln(flag);
     writeln;
    } if flag then begin inc(aa); for i:=1 to n do write(x[i],' '); writeln;  end;

   end;
     write('aa= ',aa);

   1: close (output);
 end.

         uses strutils;
          const eps=1e-14;
          besk=20000000000000000; label 4,1,3,2,44,22;
          type mas=array[-1000000..1400000+1] of int64;
          integer=longint;     zap=record  x,y,z:int64; end;
           zap1=^zap;
            var pos,ii,qqq,oldpos,jj,kolvzv,sdvig,dl,i1,j1,mask,stepp,n2,i,j,k,l,step,k1,mesto:longint;
           oldss,smin,ss3,ss,ss1,ss2:string;
           aans:zap;
           pqqq:zap;  bet,al:extended; fl1,fl2,fl:boolean;
           drans,dr3,dr1,dr2,pt,ott1,ott2:zap;
          ver:array[-1..500,-1..5] of extended;
           verugad:array[-2..200,-2..200,-2..200] of extended;
          nomer,nap,ot,stepen,delit,pq,pp1,pp2,period, dolg,ot1,ot2,oldgr,predsum,pmin,tmin,aa,bb,kool,sum,number,imin,kolreber,kolstan,qq,kol,chisl,znam,n,m,ttt,numpos,vx,vy,ans,up,down,ymin,ymax,imax,t3,qq1,qq2,q1,q2,ost,koll,w,dx,dy,time,p3,p4,qqqq,tt,pmax,pmax2,p1,p2,ott,hh,pos0,pos1,pos2,pp,mm,maxot,tmax,nn,kk,modul,t0,n1,q,t,p:int64; flag1:boolean;
          zzz,fact,z,stan,a2,invx,invy,summ,place,str,b2,z1,sum1,sum0,d0,d1,ccc,c,d,a,b:mas; flag2,flag:boolean;  pl:longint;
          oldmax,newmax,posmax,zapas,razn,oldll,oldrr,ppp,shag,posx,posy,minx,miny,maxx,maxy,kolplus,kolminus,razr,jmax,gr,grr,ener,dob,cc,dist,tt3,tt1,tt2,ugg,aa1,aa2,r,ug:int64;
          zan2,zan1,prost,marked,zan:array[-1000000..1000000] of boolean;
           num,start,finish,left,right,zz,ll,rr,path,lx,a3,a4,predok,a1,b1:array[-1000000..1500000] of int64;
           ppole1,ppole2,ppole:array[-1000000..3000000] of char;
          bufer, str1,str2,stroka:array[-1000..1000000] of char;
         dinam:array[-100000..1000000] of extended;
         t1,t2,al1,bet1,cosa,sina,cosb,sinb,rx,ry,sdvigx,sdvigy,px,py,h1,h2,h,l1,l2,otmax,v:int64;
          dddd,ssumitog,profil:array[-100..110,-100..110,-100..110] of int64;
          sss1,sss2,sp,sss:array[-10..1100005] of string;
          newpole,pole:array[-1..2100,-1..2700] of char;
          verch,verzn:array[-10..1100000] of int64;
          dd1,dd2,ddinv:array[-1..110000,-1..30] of int64;
          dd:array[-1..100001,0..128] of int64;
          poss:int64;
          obmen,ch:char;

          ff,flagg1:boolean;
          oldx,oldy,numx,numy,xleft,xright,s,znach,newplace,newstr,next,prev,xx,yy,aold,x,y:array[-10000..1700002] of int64;
          dp:array[0..3,-1..910,0..12] of int64;
           function srav(i,j:longint):boolean; label 44;
                begin
                 if (a[i]<a[j]) then begin srav:=true; goto 44;  end;
                if a[i]>a[j] then begin  srav:=false; goto 44;   end;
                 if a[i]=a[j] then if a1[i]<a1[j] then srav:=true else srav:=false;
                     44:
                end;

              procedure sl (k,l,m:integer);  {k- dlina, l,m - nachalo dvuh blokov}
                 begin
                i:=l;j:=m; flag:=true; step:=0;while flag do begin
               if (srav(i,j)) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];end;
                inc(step);inc(i);
                {writeln('step=',step,' i=',i);} end;
               if (not srav(i,j)) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];end;
               inc(step);inc(j);end;
               if  ((i>=l+k) or (j>=m+k)) then flag:=false;
                  end;
                   if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];inc(step);inc(j);until (j>=m+k);
                    if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];inc(step);inc(i);until (i>=l+k);
                   end;
             procedure sort(var c:mas);
                    begin

                       k:=1; repeat
                       l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
                      for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i];a2[i]:=b2[i]; end;
                         until (k>=n);

                      end;

             function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
             function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

        {   function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
           tt:zap; tt1:zap1;  fl:boolean;
        begin
           fl:=false;
           if a<b then begin r:=a;a:=b;b:=r; fl:=true; end;
           x2:=1;x1:=0;y2:=0;y1:=1;
           while b>0 do
              begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
                   a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
              end;
            if not fl then begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt; end else
                     begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=y;tt.p3:=x; tt1:=@tt; end;
                  evkl:=tt1;
        end;

         }
     function phi(a,b:double):double; label 222;var p:double;
       begin
        if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
        if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
        if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
        if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
        if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
        222: phi:=p;
      end;

  function nod(a,b:int64):int64; var p,t:int64;
     begin
         a:=abs(a); b:=abs(b);
         if (a>0)and(b>0) then
         begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
          p:=a;
          end else if a=0 then p:=b else p:=a;
         nod:=p;
     end;
      function arccos(tt:extended):extended;
         begin
          if abs(tt)>1-1e-13 then
          if tt>0 then  arccos:=0 else arccos:=pi;
          if tt=0 then arccos:=pi/2 else
          if abs(tt)<=1-1e-13 then if tt>=0 then arccos:=arctan(sqrt(1-tt*tt)/tt)
          else arccos:=pi+arctan(sqrt(1-tt*tt)/tt);

         end;

              function nok(a,b:int64):int64;
               begin  nok:=(a*b) div nod(a,b);  end;

             function degg(a:int64;k:int64):int64; var p:int64;    label 4;
                  begin
                   if k<=0 then degg:=1
                   else if odd(k) then degg:=(degg(a,k-1)*a) mod modul  else
                     begin  p:=degg(a,k div 2);  degg:=(p*p) mod modul;    end;

                 end;

             function zaprmax(left,right:longint):int64;
                begin
                      if left>=right then zaprmax:=y[left] else
                 begin
                  if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
                      begin
                      if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
                      if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);
                      end;

                  end;

                 end;

              function zaprmin(left,right:longint):int64;
                begin
                if left>=right then zaprmin:=y[left] else
                   begin
                 if not odd(left) and odd(right) then zaprmin:=zaprmin(left shr 1,right shr 1) else
                    begin
                     if odd(left) then  zaprmin:=min(zaprmin(left+1,right),y[left]);
                     if not odd(right) then zaprmin:=min(zaprmin(left,right-1),y[right]);
                     end;
                   end;

                                end;

      procedure udal(ii:longint);
   begin  next[prev[ii]]:=next[ii];prev[next[ii]]:=prev[ii];  end;

           function nomerr(gr:int64):int64;
            var ot,aa,bb,cc:int64; fl:boolean;
                 begin
                aa:=1; bb:=p;  cc:=aa; fl:=false;
                  while abs(aa-bb)>1 do
                     begin
                       cc:=(aa+bb) shr 1;
                        writeln('cc=++ ',cc);
                      if y[cc]<gr then aa:=cc else bb:=cc;

                     end;
                      writeln(' cc= ',cc);
                   {  cc:=max(cc-3,0);
                       }  repeat inc(cc) until y[cc]>=gr;
                          if y[cc]=gr then fl:=true else fl:=false;
                          if fl then nomerr:=a1[cc] else nomerr:=-1000;
                           nomerr:=cc;
                 end;

           function pprost(pp:int64):boolean;
            var i,j,t:longint; tt:extended; fl:boolean;
               begin
               tt:=pp;
               tt:=sqrt(tt);
               fl:=true;
               for i:=2 to round(tt) do if pp mod i=0 then  fl:=false;
               pprost:=fl;
               end;

           function gl(c:char):boolean;
                  begin
              if (c='a')or (c='o')or(c='e')or(c='i')or(c='u') then gl:=true else gl:=false;
                  end;

    function slog(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.y+d1.y*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        slog:=@ans;
    end;

    function umn(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        umn:=@ans;
    end;

  function bincoef(ii,jj:longint):int64;
var t1,t2,t3,p1,p2,p3,ot:int64;
begin
  p1:=fact[ii];
  p2:=fact[jj];
  p3:=fact[ii-jj];
  t2:=degg(p2,modul-2);
  t3:=degg(p3,modul-2);
  ot:=((p1*t2) mod modul*t3) mod modul;
  bincoef:=ot;
end;

    begin
  {   assign (input,'D:\Projects\input.txt');reset(input);
     assign (output,'D:\Projects\output.txt'); rewrite(output);
   }
     modul:=998244353;
     readln(n,m);
     fact[0]:=1;
     for i:=1 to 500000 do fact[i]:=(fact[i-1]*i) mod modul;

    { for i:=-10 to 10 do writeln(i,' ',bincoef(100000,i));
     }

    ot:=0;
    for i:=2 to ((n+1) div 2) do
      begin
        ot:=(ot+(bincoef(n-2,i-2)) mod modul) mod modul;

      end;
     { ot:=ot*2 mod modul;
      }
     { writeln('ot= ',ot);
      }
     pp:=(bincoef(m,n-1)*(n-2)) mod modul;
    { writeln('mnog= ',pp);
    } ot:=(ot*pp) mod modul;
    { ot:=ot*degg(2,modul-2) mod modul;
     }

    writeln(ot*2);
    goto 1;
    writeln('-----------');
  pp:=1;
  for i:=1 to n do pp:=pp*m;
  aa:=0;
 for mask:=0 to pp-1 do
   begin
      tt:=mask; flag:=true;
      for i:=1 to m do
        begin
           x[i]:=tt mod m+1;
           tt:=tt div m;

        end;
   {   writeln('mask= ',mask);
     for i:=1 to n do write(x[i],' '); writeln;
   }  flag:=true;
     for i:=0 to n+m do z[i]:=0;
     for i:=1 to n do inc(z[x[i]]);
   {  for i:=0 to n+m do if z[i]>1 then flag:=false;
     writeln(flag);
   }  bb:=0;
     for i:=1 to n do for j:=i+1 to n do if x[i]=x[j] then inc(bb);
     if bb<>1 then flag:=false;
     tmax:=0;
     for i:=1 to n do if x[i]>tmax then begin tmax:=x[i]; imax:=i;   end;
    { writeln('imax= ',imax);
    } for i:=1 to imax-1 do if x[i]>=x[i+1] then flag:=false;
     for i:=imax to n-1 do if x[i]<=x[i+1] then flag:=false;
    { writeln(flag);
     writeln;
    } if flag then begin inc(aa); for i:=1 to n do write(x[i],' '); writeln;  end;

   end;
     write('aa= ',aa);

   1: close (output);
 end.