#include <bits/stdc++.h>
using namespace std;
int main() {
  const int mod = 1e9 + 7;
  int a, b, dp[100001][2];
  scanf("%d%d", &a, &b);
  memset(dp, -1, sizeof dp);
  function<int(int, int)> solve = [&](int n, int r) {
    if (n >= b) return 1;
    int& ref = dp[n][r];
    if (ref != -1) return ref;
    ref = 0;
    ref += r ? solve(n + 3, 0) : solve(n + 2, 0) + solve(n + 1, 1);
    ref %= mod;
    return ref;
  };
  printf("%d", (solve(0, 0) * 2 + 2) % mod);
}
