#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
long fib(int n) {
  vector<long long> dp(n + 1);
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= n; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  return (2 * dp[n]) % MOD;
}
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  cout << (fib(n) + fib(m)) % MOD - 2;
}
