#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
const long long modd = 1e9 + 7;
long long f[N][3];
long long ans[N];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  f[1][1] = 2;
  f[2][1] = 4;
  for (int i = 3; i <= n; ++i) f[i][1] = (f[i - 1][1] + f[i - 2][1]) % modd;
  f[1][2] = 4;
  f[2][2] = 6;
  for (int i = 3; i <= n; ++i)
    f[i][2] = (f[i - 1][2] + f[i - 2][2] - 2 + modd) % modd;
  ans[1] = f[n][1];
  ans[2] = f[n][2];
  for (int i = 3; i <= m; ++i) {
    ans[i] = (ans[i - 1] + ans[i - 2] - 2 + modd) % modd;
  }
  printf("%lld", ans[m]);
  return 0;
}
