N,P=map(int,input().split()) ans=0 bino=[[0]*(N+1) for x in range(N+1)] bino[0][0]=1 for x in range(N+1): for y in range(N+1): if y: bino[x][y]+=bino[x][y-1] if x: bino[x][y]+=bino[x-1][y] bino[x][y]%=P def comb(n,k): if k<0: return 0 if n