#include<stdio.h>

int n,k,r[502],z[502],i,j,v;
long long s,a=578537;
void calcul(int z1[502], int z2[502], int n)
{
    int x[502],i,j;
    long long s,t;
    for (j=1;j<=n;j++)
    {
        s=0;
        for (i=1;i<=j;i++)
        {
            t = z1[i];
            t = (t * z2[j - i +1]) % a;
            s = (s + t) % a;
        }
        x[j] = s;
    }
    for (j=1;j<=n;j++)
    {
        z1[j] = x[j];
    }
}
int main()
{
    freopen("sumk.in","rt",stdin);
    freopen("sumk.out","wt",stdout);
    scanf("%d%d",&n,&k);
    //calculez modulo, cu triunghiul Pascal, combinarile C(k+p-2,k-1) pentru p=1,2,...,n
    r[1]=1;
    for (j=1;j<=k;j++)
    {
        for (i=2;i<=n;i++)
        {
            r[i] = (r[i-1] + r[i]) % a;
        }
    }
    v=n;
    z[1]=1;
    while (v!=0)
    {
        if (v%2==1)
        {
            calcul(z,r,n);
        }
        calcul(r,r,n);
        v = v / 2;
    }
    s=0;
    for (i=1;i<=n;i++)
    {
        s = (s + z[i]) % a;
    }
    printf("%d",(int)s);
    fclose(stdout);
    fclose(stdin);
    return 0;
}
