#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define _zero(a) memset(a, 0, sizeof(a))
#define _far(a) memset(a, 0x3f,sizeof (a))
#define __far(a) memset(a, -0x3f,sizeof (a))
#define far 0x3f3f3f3f
#define endl '\n'
#define int long long
#define xx first
#define yy second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define rep(a,b,c) for(int (a) = (b);(a)<=(c);(a)++)
#define per(a,b,c) for(int (a)=(b);(a)>=(c);(a)--)
#define sqr(a) (a)*(a)
#define VI vector<int>
#define VII vector<vector<int>>
#define pb push_back
#define PII pair<int,int>
typedef long long ll;
typedef double dd;
typedef long double ld;
using namespace std;
const int inf = 1e10;
const int mod = 998244353;
const int maxn = 2e5 + 1000;
const ld pi = atan2(0, -1);//arctan(y/x);
const ld eps = 1e-4;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
const int N = 12, M = 1 << N;
int f[N][M];
VI state[M];
bool st[M];
int n,m;
signed main()
{
IOS;
while (cin >> n >> m, n || m)
{
for (int i = 0; i < 1 << n; i ++)
{
int cnt = 0;
bool use = true;
for (int j = 0; j < n; j ++)
{
if (i >> j & 1)
{
if (cnt % 2) use = false;
cnt = 0;
}
else cnt ++;
}
if (cnt % 2) use = false;
st[i] = use;
}
for (int i = 0; i < 1 << n; i ++)
{
//if (!st[i]) continue;
state[i].clear();
for (int j = 0; j < 1 << n; j ++)
{
//if (!st[j]) continue;
if ((i&j) == 0 && st[i | j]) state[i].pb(j);
}
}
_zero(f);
f[0][0] = 1;
rep(i,1,m)
for (int j = 0; j < 1 << n; j ++)
for (int k : state[j])
f[i][j] += f[i-1][k];
cout << f[m][0] << endl;
}
return 0;
}
01-16
9777

02-24
236

08-10
465

07-07
435
