#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long dp[(long long)1e5 + 5] = {0};
  dp[1] = 1LL, dp[2] = 2LL, dp[3] = 3, dp[4] = 5;
  for (long long i = 5; i <= max(n, m); i++)
    dp[i] = (dp[i - 2] + (2LL * dp[i - 3]) % mod + dp[i - 4]) % mod;
  long long temp = (dp[m] - 1LL + mod) % mod;
  long long ans = (2LL * (temp + dp[n])) % mod;
  cout << ans << '\n';
  return 0;
}
