code
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int b[40][40];
int main(){
int n,m;
cin>>n>>m;
b[0][0]=1;//initialize
for(int i=1;i<=m;i++){
for(int j=0;j<n;j++){
if(j==0){//special point
b[i][0]=b[i-1][1]+b[i-1][n-1];
}else if(j==n-1){
b[i][n-1]=b[i-1][0]+b[i-1][n-2];
}else{
b[i][j]=b[i-1][j-1]+b[i-1][j+1];
}
}
}
cout<<b[m][0];
return 0;
}