Permutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as pi. We'll call number n the size or the length of permutation p1, p2, ..., pn.

We'll call position i (1 ≤ i ≤ n) in permutation p1, p2, ..., pn good, if |p[i] - i| = 1. Count the number of permutations of size n with exactly k good positions. Print the answer modulo 1000000007 (109 + 7).

Input

The single line contains two space-separated integers n and k (1 ≤ n ≤ 1000, 0 ≤ k ≤ n).

Output

Print the number of permutations of length n with exactly k good positions modulo 1000000007 (109 + 7).

Examples

Input

1 0


Output

1


Input

2 1


Output

0


Input

3 2


Output

4


Input

4 1


Output

6


Input

7 4


Output

328

Note

The only permutation of size 1 has 0 good positions.

Permutation (1, 2) has 0 good positions, and permutation (2, 1) has 2 positions.

Permutations of size 3:

  1. (1, 2, 3) — 0 positions
  2. <image> — 2 positions
  3. <image> — 2 positions
  4. <image> — 2 positions
  5. <image> — 2 positions
  6. (3, 2, 1) — 0 positions
#include <bits/stdc++.h>
using namespace std;
const int inf_int = 1e9 + 100;
const long long inf_ll = 1e18;
const double pi = 3.1415926535898;
bool debug = 0;
long long f1(long long N, long long k);
long long f2(long long N, long long k);
long long f3(long long N, long long k);
long long f4(long long N, long long k);
long long f5(long long N, long long k);
long long p = 1e9 + 7;
long long dp1[1234][1234];
long long dp2[1324][1234];
long long dp3[1234][2134];
long long dp4[1234][1234];
long long dp5[1324][1324];
long long f1(long long n, long long k) {
  if (n < k or k < 0) return 0;
  if (dp1[n][k] or n < 4) return dp1[n][k];
  long long s =
      f1(n - 1, k - 1) + f2(n - 1, k) + f3(n - 1, k) + f4(n - 1, k - 1);
  dp1[n][k] = s % p;
  if (debug) cout << "f1 " << n << ' ' << k << ' ' << dp1[n][k] << endl;
  return dp1[n][k];
}
long long f2(long long n, long long k) {
  if (n < k or k < 0) return 0;
  if (dp2[n][k] or n < 4) return dp2[n][k];
  long long s = f5(n - 1, k - 2);
  s = s % p;
  dp2[n][k] = s;
  if (debug) cout << "f2 " << n << ' ' << k << ' ' << dp2[n][k] << endl;
  return dp2[n][k];
}
long long f3(long long n, long long k) {
  if (n < k or k < 0) return 0;
  if (dp3[n][k] or n < 4) return dp3[n][k];
  long long s =
      f1(n - 1, k) + f2(n - 1, k) + f3(n - 1, k - 1) + f4(n - 1, k - 1);
  s = s % p;
  dp3[n][k] = s;
  if (debug) cout << "f3 " << n << ' ' << k << ' ' << dp3[n][k] << endl;
  return dp3[n][k];
}
long long f4(long long n, long long k) {
  long long s;
  if (debug) cout << "f4 " << n << ' ' << k << ' ' << s << endl;
  if (debug) cout << "f4 " << n << ' ' << k << ' ' << s << endl;
  s = s % p;
  dp4[n][k] = s;
  if (debug) cout << "f4 " << n << ' ' << k << ' ' << dp4[n][k] << endl;
  return dp4[n][k];
}
long long f5(long long n, long long k) {
  if (n < k or k < 0) return 0;
  if (dp5[n][k] or n < 4) return dp5[n][k];
  long long s =
      f1(n - 1, k) + f2(n - 1, k) + f3(n - 1, k) + f4(n - 1, k) + f5(n - 1, k);
  s = s % p;
  dp5[n][k] = s;
  if (debug) cout << "f5 " << n << ' ' << k << ' ' << dp5[n][k] << endl;
  return dp5[n][k];
}
long long solve() {
  dp1[3][0] = 0;
  dp1[3][1] = 0;
  dp1[3][2] = 1;
  dp1[3][3] = 0;
  dp2[3][0] = 0;
  dp2[3][1] = 0;
  dp2[3][2] = 1;
  dp2[3][3] = 0;
  dp3[3][0] = 0;
  dp3[3][1] = 0;
  dp3[3][2] = 1;
  dp3[3][3] = 0;
  dp4[3][0] = 1;
  dp4[3][1] = 0;
  dp4[3][2] = 0;
  dp4[3][3] = 0;
  dp5[3][0] = 1;
  dp5[3][1] = 0;
  dp5[3][2] = 1;
  dp5[3][3] = 0;
  for (long long n = 4; n <= 1000; n++) {
    for (long long k = 0; k <= n; k++) {
      dp1[n][k] = (k > 0) * dp1[n - 1][k - 1] + dp2[n - 1][k] + dp3[n - 1][k] +
                  (k > 0) * dp4[n - 1][k - 1];
      dp2[n][k] = (k >= 2) * dp5[n - 1][k - 2];
      dp3[n][k] = dp1[n - 1][k] + dp2[n - 1][k] + (k > 0) * dp3[n - 1][k - 1] +
                  (k > 0) * dp4[n - 1][k - 1];
      dp4[n][k] = (n - 3 - k > 0) * dp4[n - 1][k] * (n - 3 - k) +
                  dp4[n - 1][k + 1] * (k + 1) +
                  (n - 2 - k > 0 ? 1 : 0) * dp3[n - 1][k] * (n - 2 - k) +
                  dp3[n - 1][k + 1] * k;
      dp4[n][k] += dp2[n - 1][k + 1] * (k - 1) * (k > 0) +
                   (n - k - 1 > 0) * (n - 1 - k) * dp2[n - 1][k];
      dp4[n][k] +=
          k * dp1[n - 1][k + 1] + dp1[n - 1][k] * (n - 1 - k > 0) * (n - 2 - k);
      dp4[n][k] += (n - 2 - k >= 0) * (n - 2 - k) * dp5[n - 1][k] +
                   dp5[n - 1][k + 1] * (k + 1);
      dp5[n][k] = dp1[n - 1][k] + dp2[n - 1][k] + dp3[n - 1][k] +
                  dp4[n - 1][k] + dp5[n - 1][k];
      dp5[n][k] = dp5[n][k] % p;
      dp4[n][k] = dp4[n][k] % p;
      dp3[n][k] = dp3[n][k] % p;
      dp2[n][k] = dp2[n][k] % p;
      dp1[n][k] = dp1[n][k] % p;
    }
  }
  for (int i = 0; i <= 4; i++) {
    if (debug)
      cout << dp1[4][i] << ' ' << dp2[4][i] << ' ' << dp3[4][i] << ' '
           << dp4[4][i] << ' ' << dp5[4][i] << endl;
  }
  long long n, m;
  cin >> n >> m;
  if (n == 1) {
    if (m == 0)
      cout << 1;
    else
      cout << 0;
  } else if (n == 2) {
    if (m == 2)
      cout << 1;
    else if (m == 0)
      cout << 1;
    if (m == 1) cout << 0;
  } else if (n == 3) {
    if (m == 0)
      cout << 2;
    else if (m == 2)
      cout << 4;
    else
      cout << 0;
  } else {
    cout << (dp1[n][m] + dp2[n][m] + dp3[n][m] + dp4[n][m] + dp5[n][m]) % p;
  }
  return 0;
}
int main() {
  int t = 1;
  debug = 0;
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  while (t--) {
    solve();
  }
  if (debug) {
    cerr << endl;
    cerr << "time -> " << (1.0 * clock() / CLOCKS_PER_SEC) << endl;
  }
}
