#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long solve(long long n) {
  if (n == 1) return 2;
  vector<vector<long long>> dp(n, vector<long long>(2));
  dp[0][0] = 2;
  dp[1][0] = 2;
  dp[1][1] = 2;
  for (long long i = 2; i < n; i++) {
    dp[i][0] = (dp[i - 1][0] + dp[i - 1][1]) % MOD;
    dp[i][1] = dp[i - 1][0];
  }
  return (dp[n - 1][0] + dp[n - 1][1]) % MOD;
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  cout << (solve(n) + solve(m) - 2 + MOD) % MOD << "\n";
  return 0;
}
