#include <bits/stdc++.h>
using namespace std;
long long dp[112345][4];
void checker(int n) {}
int main() {
  int i, j, n, m;
  cin >> n >> m;
  int t = max(n, m);
  dp[2][0] = 1;
  dp[2][1] = 1;
  dp[2][2] = 1;
  dp[2][3] = 1;
  dp[1][0] = 0;
  dp[1][1] = 1;
  dp[1][2] = 1;
  dp[1][3] = 0;
  for (i = 3; i <= t; i++) {
    dp[i][0] = dp[i - 2][1] + dp[i - 2][3];
    dp[i][1] = dp[i - 2][1] + dp[i - 2][2] + dp[i - 2][3];
    dp[i][2] = dp[i - 2][0] + dp[i - 2][1] + dp[i - 2][2];
    dp[i][3] = dp[i - 2][0] + dp[i - 2][2];
    for (j = 0; j < 4; j++) dp[i][j] = dp[i][j] % 1000000007;
  }
  long long ans = 0;
  int val[2] = {n, m};
  for (i = 0; i < 2; i++)
    for (j = 0; j < 4; j++) ans += dp[val[i]][j];
  ans -= 2;
  ans %= 1000000007;
  if (ans < 0) ans += 1000000007;
  cout << ans << endl;
}
