#include <bits/stdc++.h>
using namespace std;
long long n, m, dp1[100005][4], dp2[100005][2], ans;
long long solve1(long long n, long long type) {
  if (n == 2) return 1;
  if (dp1[n][type] == -1) {
    long long ans = 0;
    if (type == 0)
      ans = solve1(n - 1, 1);
    else if (type == 1)
      ans = (solve1(n - 1, 2) + solve1(n - 1, 3)) % 1000000007;
    else if (type == 2)
      ans = (solve1(n - 1, 0) + solve1(n - 1, 1)) % 1000000007;
    else
      ans = solve1(n - 1, 2);
    dp1[n][type] = ans;
  }
  return dp1[n][type];
}
long long solve2(long long i, bool j) {
  if (i < 2) return 1;
  if (dp2[i][j] == -1)
    dp2[i][j] = (solve2(i - 1, !j) + solve2(i - 2, !j)) % 1000000007;
  return dp2[i][j];
}
int main() {
  memset(dp1, -1, sizeof(dp1)), memset(dp2, -1, sizeof(dp2));
  scanf("%lld", &n), scanf("%lld", &m);
  ans = 0;
  if (m == 1)
    ans = 2;
  else {
    for (int type = 0; type < 4; type++) {
      ans += solve1(m, type);
      ans %= 1000000007;
    }
  }
  ans = (ans - 2 + 1000000007) % 1000000007;
  for (int j = 0; j < 2; j++) {
    ans += solve2(n, j);
    ans %= 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
