#include <bits/stdc++.h>
using namespace std;
inline long long gi() {
  long long f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
const long long N = 100010, Mod = 1e9 + 7;
long long n, m, a[N], b[N];
signed main() {
  n = gi();
  m = gi();
  a[1] = 2;
  a[2] = 4;
  b[1] = 0;
  b[2] = 2;
  for (long long i = 3; i <= n; i++) a[i] = (a[i - 1] + a[i - 2]) % Mod;
  for (long long i = 3; i <= m; i++) b[i] = (b[i - 1] + b[i - 2]) % Mod;
  a[1] = a[n];
  for (long long i = 2; i <= m; i++) a[i] = (a[i - 1] + b[i]) % Mod;
  printf("%lld\n", a[m]);
  return 0;
}
