#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-8;
const long long INF = 0x3f3f3f3f3f3f3f3f;
inline long long readll() {
  long long x(0), op(1);
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * op;
}
const long long M = 1e9 + 7;
int x[30][30];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool check(long long a, long long b) {
  for (int i = 1; i < a + 1; ++i) {
    for (int j = 1; j < b + 1; ++j) {
      int same = 0;
      for (int k = 0; k < 4; ++k) {
        if (x[i][j] == x[i + dx[k]][j + dy[k]]) same++;
      }
      if (same >= 2) return false;
    }
  }
  return true;
}
long long bt(long long a, long long b) {
  memset(x, -1, sizeof(x));
  long long ans = 0;
  for (int S = 0; S < 1LL << (a * b); ++S) {
    long long s = S;
    for (int i = 1; i < a + 1; ++i) {
      for (int j = 1; j < b + 1; ++j) {
        x[i][j] = (s & 1);
        s >>= 1;
      }
    }
    ans += check(a, b);
  }
  return ans;
}
const int sz = 100009;
long long dp[sz][2][2], f[sz];
void pre() {
  dp[1][0][1] = dp[1][1][0] = 1;
  f[1] = 2;
  for (int i = 2; i < sz; ++i) {
    dp[i][0][0] = dp[i - 1][1][0];
    dp[i][1][1] = dp[i - 1][0][1];
    dp[i][1][0] = (dp[i - 1][0][1] + dp[i - 1][1][1]) % M;
    dp[i][0][1] = (dp[i - 1][0][0] + dp[i - 1][1][0]) % M;
    f[i] = (dp[i][0][0] + dp[i][0][1] + dp[i][1][0] + dp[i][1][1]) % M;
  }
}
int main() {
  pre();
  long long a = readll(), b = readll();
  printf("%I64d\n", (f[a] + f[b] - 2 + M) % M);
  return 0;
}
