#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
using namespace std;
typedef long long LL;
const LL N=1000005;
const LL MOD=998244353;
LL JC[N],inv[N];
LL Pow (LL x,LL y)
{
	if (y==1) return x;
	LL lalal=Pow(x,y>>1);
	lalal=lalal*lalal%MOD;
	if (y&1) lalal=lalal*x%MOD;
	return lalal;
}
LL n,m;
LL C (LL x,LL y)	{return JC[x]*inv[y]%MOD*inv[x-y]%MOD;}
LL calc (LL x,LL y)	{return C(x+y,x);}
void solve ()
{
	LL ans=0;
	for (LL u=1;u<=min(n,m);u++)
		ans=(ans+calc(u,u)*calc(n-u,m-u)%MOD)%MOD;
	ans=ans*Pow(calc(n,m),MOD-2)%MOD;
	ans=ans*Pow(2,MOD-2)%MOD;
	ans=(ans+max(n,m))%MOD;
	printf("%lld\n",ans);
}
int main()
{
	JC[0]=1;for (LL u=1;u<=1000000;u++) JC[u]=JC[u-1]*u%MOD;
	inv[1000000]=Pow(JC[1000000],MOD-2);
	for (LL u=999999;u>=0;u--) inv[u]=inv[u+1]*(u+1)%MOD;
	scanf("%lld%lld",&n,&m);
	solve();
	return 0;
}