#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const long long mod = (long long)(1e9 + 7);
const int N = 1000010;
const int dir[][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int ans, n, m;
int mat[110][110];
bool check() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      int same = 0;
      for (int d = 0; d < 4; ++d) {
        int px = dir[d][0] + i, py = dir[d][1] + j;
        if (px < 0 || py < 0 || px >= n || py >= m) continue;
        if (mat[px][py] == mat[i][j]) same++;
      }
      if (same >= 2) return false;
    }
  }
  return true;
}
void dfs(int x, int y) {
  if (x >= n) {
    if (check()) ans++;
    return;
  }
  if (y >= m) {
    dfs(x + 1, 0);
    return;
  } else {
    mat[x][y] = 0;
    dfs(x, y + 1);
    mat[x][y] = 1;
    dfs(x, y + 1);
  }
}
long long A[N], B[N], sum[N];
void gen() {
  freopen("A.in", "w", stdout);
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 100; ++j) cout << i << " " << j << endl;
  }
}
int main() {
  A[1] = 2, A[2] = 4;
  for (int i = 3; i < N; ++i) A[i] = (A[i - 1] + A[i - 2]) % mod;
  B[1] = B[2] = 2;
  sum[1] = 2, sum[2] = 4;
  for (int i = 3; i < N; ++i) {
    B[i] = (B[i - 1] + B[i - 2]) % mod;
    sum[i] = (sum[i - 1] + B[i]) % mod;
  }
  while (cin >> n >> m) {
    cout << (A[n] + sum[m - 1]) % mod << endl;
  }
  return 0;
}
