#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long mypower(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = res * a % MOD;
    }
    b >>= 1;
    a = a * a % MOD;
  }
  return res;
}
const int N = 1e5 + 7;
long long dp[N][2];
long long f[N];
int main() {
  int n, m;
  cin >> n >> m;
  if (n > m) {
    swap(n, m);
  }
  dp[1][0] = 2;
  dp[1][1] = 0;
  for (int i = 2; i <= m; i++) {
    dp[i][0] = (dp[i - 1][0] + dp[i - 1][1]) % MOD;
    dp[i][1] = dp[i - 1][0];
  }
  long long ans = (dp[m][0] + dp[m][1] - 2 + MOD) % MOD;
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= n; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % MOD;
  }
  ans = (ans + f[n] * 2) % MOD;
  cout << ans << endl;
  return 0;
}
