#include <stdio.h>
#include <cstring>
using namespace std;
long long arr1[35];
long long arr2[35];
int main(){
int n,m;
scanf("%d %d",&n,&m);
arr1[0]=1; //一开始我们的小蛮有一个球,也只有他有
for (int z=0;z<m;z++){
for (int i=0;i<n;i++){
if (i0){ //可以传到的人可能性+1
arr2[i]=arr1[i+1]+arr1[n-1];
} else if(in-1) {
arr2[i]=arr1[i-1]+arr1[0];
} else {
arr2[i]=arr1[i-1]+arr1[i+1];
}
}
for (int i=0;i<n;i++){ //返回到原来列表,继续遍历
arr1[i]=arr2[i];
//cout<<arr1[i]<<" ";
}
memset(arr2,0,sizeof(arr2));
//cout<<endl;
}
long long ans=arr1[0];
printf("%lld",ans);
}