#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e6 + 7;
int n, m;
long long dp[Nmax];
const long long mod = 1e9 + 7LL;
int main() {
  cin >> n >> m;
  dp[1] = 2;
  dp[2] = 4;
  for (int i = 3; i <= max(n, m); i++) dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  cout << (dp[n] + dp[m] - 2) % mod << endl;
  return 0;
  return 0;
}
