import sys
d0=[0]*1024
d1=[[0 for i in range(286)]for j in range(1024)]
B=[1,2,4,8,16,32,64,128,256,512]

def init():
  global d
  for i in range(1024):
    binary=format(i,'b')
    n0=binary.count('1')
    d0[i]=n0
    if n0==1:
      d1[i][B.index(i)]=1
    else:
      for j in range(len(binary)):
        dp=n0*j
        if binary[-j-1]=='1':
          i2=i-B[j]
          for k in range(286-dp):
            d1[i][k+dp]+=d1[i2][k]
  return
  
def f0070(n,s):
  x=sum([d1[i][s] for i in range(1024) if d0[i]==n])
  return x

init()
for a in sys.stdin:
  n,s=map(int,a.split())
  print f0070(n,s)