#include <bits/stdc++.h>
using namespace std;
long long n, m, dp[199999][2];
int main() {
  dp[0][0] = dp[0][1] = 1;
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= max(n, m); i++) {
    (dp[i][0] += dp[i - 1][1]) %= 1000000007;
    (dp[i][1] += dp[i - 1][0]) %= 1000000007;
    if (i > 1) {
      (dp[i][1] += dp[i - 2][0]) %= 1000000007;
      (dp[i][0] += dp[i - 2][1]) %= 1000000007;
    }
  }
  long long ans =
      ((dp[m][0] + dp[m][1] + dp[n][0] + dp[n][1] - 2) % 1000000007 +
       1000000007) %
      1000000007;
  printf("%lld\n", ans);
  return 0;
}
