#include <bits/stdc++.h>
int CH, NEG;
template <typename TP>
inline void read(TP& ret) {
  ret = NEG = 0;
  while (CH = getchar(), CH < '!')
    ;
  if (CH == '-') NEG = true, CH = getchar();
  while (ret = ret * 10 + CH - '0', CH = getchar(), CH > '!')
    ;
  if (NEG) ret = -ret;
}
template <typename TP>
inline void reads(TP& ret) {
  while (ret = getchar(), ret < '!')
    ;
  while (CH = getchar(), CH > '!')
    ;
}
const int ansmod = 1000000007;
int N, K;
int g[16][10][16] = {0};
int h[5][10][2][2][16] = {0};
int f[401][210][16] = {0};
int num[16];
int i, j, k, A, B, use, last, first, now1, now2, cnt, can, Time, ans;
int col[4] = {0};
int main() {
  for (A = (0); A <= (16 - 1); A++) {
    num[B = A] = 0;
    while (B) num[A] += (B & 1), B >>= 1;
  }
  for (A = (0); A <= (16 - 1); A++) {
    memset(h, 0, sizeof h);
    h[1][0][0][0][A] = h[1][1][1][0][A | 1] = h[1][2][1][1][A | 1] =
        h[1][1][0][1][A | 1] = 1;
    if (!(A & 1)) h[1][1][1][1][A | 1] = 1;
    for (i = (1); i <= (3); i++)
      for (use = (0); use <= (8); use++)
        for (last = (0); last <= (1); last++)
          for (first = (0); first <= (1); first++)
            for (B = (0); B <= (16 - 1); B++)
              if (h[i][use][last][first][B])
                for (now1 = (0); now1 <= (1); now1++)
                  for (now2 = (0); now2 <= (1); now2++) {
                    if (!now1 && !now2 && !((B >> i) & 1)) {
                      h[i + 1][use + 1][1][first][B | (1 << i)] +=
                          h[i][use][last][first][B];
                      if (h[i + 1][use + 1][1][first][B | (1 << i)] >= ansmod)
                        h[i + 1][use + 1][1][first][B | (1 << i)] -= ansmod;
                    };
                    {
                      h[i + 1][use + now1 + now2][now2][first]
                       [B | ((now1 | now2) << i)] += h[i][use][last][first][B];
                      if (h[i + 1][use + now1 + now2][now2][first]
                           [B | ((now1 | now2) << i)] >= ansmod)
                        h[i + 1][use + now1 + now2][now2][first]
                         [B | ((now1 | now2) << i)] -= ansmod;
                    };
                    if (!last && !now1) {
                      h[i + 1][use + 1 + now2][now2][first]
                       [B | (1 << i) | (1 << (i - 1))] +=
                          h[i][use][last][first][B];
                      if (h[i + 1][use + 1 + now2][now2][first]
                           [B | (1 << i) | (1 << (i - 1))] >= ansmod)
                        h[i + 1][use + 1 + now2][now2][first]
                         [B | (1 << i) | (1 << (i - 1))] -= ansmod;
                    };
                    if (!now1 && !now2 && !((B >> i) & 1) &&
                        !((B >> (i - 1)) & 1)) {
                      h[i + 1][use + 1][1][first | (i == 1)]
                       [B | (1 << i) | (1 << (i - 1))] +=
                          h[i][use][last][first][B];
                      if (h[i + 1][use + 1][1][first | (i == 1)]
                           [B | (1 << i) | (1 << (i - 1))] >= ansmod)
                        h[i + 1][use + 1][1][first | (i == 1)]
                         [B | (1 << i) | (1 << (i - 1))] -= ansmod;
                    };
                  }
    for (use = (0); use <= (8); use++)
      for (B = (0); B <= (16 - 1); B++) {
        h[4][use + 1][1][1][B | 9] += h[4][use][0][0][B];
        if (h[4][use + 1][1][1][B | 9] >= ansmod)
          h[4][use + 1][1][1][B | 9] -= ansmod;
      };
    for (use = (0); use <= (8); use++)
      for (B = (0); B <= (16 - 1); B++)
        if (!(B & 1) && !(B & 8)) {
          h[4][use + 1][1][1][B | 9] += h[4][use][0][0][B];
          if (h[4][use + 1][1][1][B | 9] >= ansmod)
            h[4][use + 1][1][1][B | 9] -= ansmod;
        };
    for (use = (0); use <= (8); use++)
      for (last = (0); last <= (1); last++)
        for (first = (0); first <= (1); first++)
          for (B = (0); B <= (16 - 1); B++) {
            g[A][use][B] += h[4][use][last][first][B];
            if (g[A][use][B] >= ansmod) g[A][use][B] -= ansmod;
          };
  }
  for (A = (0); A <= (16 - 1); A++)
    for (B = (0); B <= (16 - 1); B++) {
      col[0] = col[1] = col[2] = col[3] = 0;
      cnt = 0;
      for (i = (0); i <= (4 - 1); i++) col[i] = ((A >> i) & 1), cnt += col[i];
      can = true;
      for (i = (0); i <= (4 - 1); i++)
        if ((B >> i) & 1) {
          if (col[i] || col[(i + 1) % 4]) can = false;
          col[i] = col[(i + 1) % 4] = true;
          cnt++;
        }
      if (!can) continue;
      K = 0;
      for (i = (4 - 1); i >= (0); i--) K = (K << 1) | col[i];
      f[0][cnt][K]++;
    }
  for (i = (0); i <= (400 - 1); i++)
    for (j = (0); j <= (200); j++)
      for (A = (0); A <= (16 - 1); A++)
        if (f[i][j][A])
          if (i & 1) {
            for (k = (0); k <= (8); k++)
              for (B = (0); B <= (16 - 1); B++) {
                f[i + 1][j + k][B] +=
                    (long long)f[i][j][A] * g[A][k][B] % ansmod;
                if (f[i + 1][j + k][B] >= ansmod) f[i + 1][j + k][B] -= ansmod;
              };
          } else {
            for (k = (0); k <= (16 - 1); k++) {
              f[i + 1][j + num[k]][A | k] += f[i][j][A];
              if (f[i + 1][j + num[k]][A | k] >= ansmod)
                f[i + 1][j + num[k]][A | k] -= ansmod;
            };
          }
  Time = 1;
  while (Time-- > 0) {
    read(N), read(K);
    int ans = 0;
    for (A = (0); A <= (16 - 1); A++) {
      ans += f[2 * N][K][A];
      if (ans >= ansmod) ans -= ansmod;
    };
    for (i = (1); i <= (K); i++) ans = (long long)ans * i % ansmod;
    printf("%d\n", ans);
  }
  getchar();
  getchar();
  return 0;
}
