#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
const long long mod = 1e9 + 7;
int n, m;
long long dp[maxn];
int main() {
  dp[1] = dp[0] = 1;
  scanf("%d%d", &n, &m);
  if (n < m) {
    swap(n, m);
  }
  for (int i = 2; i <= n; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << (dp[n] + dp[m] - 1) * 2 % mod << endl;
  return 0;
}
