#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > p;
vector<int> q;
int cnt[(1 << 4)][(1 << 4)][20];
int cnt2[(1 << 4)][20];
void dfs(int pos, int in, int out, int tri) {
  if (pos == p.size()) {
    int mask = 0, i;
    for ((i) = 0; (i) < (int)(12); (i)++)
      if (out & (1 << i)) mask |= (1 << (i / 3));
    for ((i) = 0; (i) < (int)(16); (i)++)
      if ((mask & i) == mask) cnt[in][i][tri]++;
    return;
  }
  dfs(pos + 1, in, out, tri);
  int in2 = p[pos].first, out2 = p[pos].second;
  if ((in & in2) == 0 && (out & out2) == 0)
    dfs(pos + 1, (in | in2), (out | out2), tri + 1);
}
void dfs2(int pos, int in, int tri) {
  if (pos == q.size()) {
    cnt2[in][tri]++;
    return;
  }
  dfs2(pos + 1, in, tri);
  int in2 = q[pos];
  if ((in & in2) == 0) dfs2(pos + 1, (in | in2), tri + 1);
}
long long dp[210][210][16];
long long func(int level, int tri, int mask) {
  int i, ans = 0;
  if (dp[level][tri][mask] != -1) return dp[level][tri][mask];
  if (level == 0) {
    if (tri < 20)
      for ((i) = 0; (i) < (int)(16); (i)++)
        if ((mask & i) == i) ans += cnt2[i][tri];
    return dp[level][tri][mask] = ans;
  }
  int in = mask;
  while (1) {
    for ((i) = 0; (i) < (int)(13); (i)++)
      if (i <= tri && cnt[in][mask][i] > 0) {
        long long tmp = func(level - 1, tri - i, (mask ^ in));
        ans = (ans + tmp * cnt[in][mask][i]) % 1000000007ll;
      }
    if (in == 0) break;
    in = ((in - 1) & mask);
  }
  return dp[level][tri][mask] = ans;
}
int main(void) {
  int i, j, k;
  for ((i) = 0; (i) < (int)(12); (i)++) p.push_back(make_pair(0, (1 << (i))));
  for ((i) = 0; (i) < (int)(4); (i)++)
    p.push_back(make_pair(0, (1 << (3 * i + 2)) + (1 << ((3 * i + 3) % 12))));
  for ((i) = 0; (i) < (int)(4); (i)++)
    p.push_back(make_pair((1 << (i)), (1 << (i * 3)) * 7));
  for ((i) = 0; (i) < (int)(4); (i)++)
    p.push_back(make_pair((1 << (i)) + (1 << ((i + 1) % 4)),
                          (1 << (i * 3)) * 7 + (1 << ((i + 1) % 4 * 3)) * 7));
  dfs(0, 0, 0, 0);
  for ((i) = 0; (i) < (int)(4); (i)++) q.push_back((1 << (i)));
  for ((i) = 0; (i) < (int)(4); (i)++)
    q.push_back((1 << (i)) + (1 << ((i + 1) % 4)));
  dfs2(0, 0, 0);
  int N, K;
  cin >> N >> K;
  for ((i) = 0; (i) < (int)(N + 1); (i)++)
    for ((j) = 0; (j) < (int)(K + 1); (j)++)
      for ((k) = 0; (k) < (int)(16); (k)++) dp[i][j][k] = -1;
  long long ans = func(N, K, 15);
  for (i = 1; i <= K; i++) ans = ans * i % 1000000007ll;
  cout << ans << endl;
  return 0;
}
