#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int n, m;
long long f[maxn], a[maxn], b[maxn], c[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  f[1] = 0, f[2] = 2;
  f[3] = 4;
  for (int i = 4; i <= n + 1; i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
  a[1] = 0;
  a[2] = 2;
  for (int i = 3; i <= n; i++) a[i] = (a[i - 1] + f[i - 1]) % mod;
  b[1] = 4;
  b[2] = 6;
  for (int i = 3; i <= n; i++) b[i] = (b[i - 1] + b[i - 2] - 2 + mod) % mod;
  c[1] = f[n + 1], c[2] = b[n];
  for (int i = 3; i <= m; i++) c[i] = (c[i - 2] + c[i - 1] - a[n] + mod) % mod;
  cout << c[m] << endl;
  return 0;
}
