#include <bits/stdc++.h>
using namespace std;
long long dp[100001][4];
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int tn = min(n, m);
  int tm = max(n, m);
  n = tn;
  m = tm;
  dp[1][0] = 1;
  dp[1][1] = 1;
  dp[2][2] = 1;
  dp[2][3] = 1;
  dp[2][0] = 1;
  dp[2][1] = 1;
  for (int i = 3; i <= m; i++) {
    dp[i][0] = dp[i - 1][1] + dp[i - 1][3];
    dp[i][1] = dp[i - 1][0] + dp[i - 1][2];
    dp[i][2] = dp[i - 2][1] + dp[i - 2][3];
    dp[i][3] = dp[i - 2][0] + dp[i - 2][2];
    dp[i][0] %= 1000000007;
    dp[i][1] %= 1000000007;
    dp[i][2] %= 1000000007;
    dp[i][3] %= 1000000007;
  }
  long long x = dp[m][0] + dp[m][1] + dp[m][2] + dp[m][3];
  long long r = 0;
  long long ans = 0;
  while (n > 1) {
    if (r == 0) r = 1;
    r *= 2;
    r %= 1000000007;
    n -= 1;
  }
  ans = x + r;
  ans %= 1000000007;
  cout << ans << endl;
}
