#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long double PI = 2 * acos(0.0);
const vector<long long int> dx = {1, -1, 0, 0};
const vector<long long int> dy = {0, 0, 1, -1};
template <typename T = long long int>
vector<T> ga(long long int n, bool oneIndexed = false) {
  vector<T> a = vector<T>(n + oneIndexed);
  for (long long int i = 0; i < n; i++) {
    T p;
    cin >> p;
    a[i + oneIndexed] = p;
  }
  return move(a);
}
template <typename T, typename A>
void pa(vector<T, A> const &a, long long int begin = 0,
        long long int end = -1) {
  if (end == -1) end = (long long int)a.size() - 1;
  for (long long int i = begin; i <= end; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long int onetiletwotile(long long int len) {
  if (len == 1) {
    return 2;
  }
  if (len <= 0) {
    return 1;
  }
  vector<long long int> dp(len + 2, 1);
  dp[len + 1] = 0;
  dp[len] = 2;
  for (long long int i = len - 1; i >= 1; i--) {
    dp[i] = dp[i + 1] + dp[i + 2];
    dp[i] %= MOD;
  }
  return dp[1];
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  if (n <= 2 && m <= 2) {
    long long int a;
    if (n == 1 && m == 1) {
      a = 2;
    } else if ((n == 1 && m == 2) || (n == 2 && m == 1)) {
      a = 4;
    } else {
      a = 6;
    }
    cout << a;
    return;
  } else if (m <= 2) {
    long long int t = m;
    m = n;
    n = t;
  }
  vector<vector<vector<long long int> > > dp(
      m, vector<vector<long long int> >(2, vector<long long int>(2, 0)));
  dp[m - 1][0][0] = 1;
  dp[m - 1][1][1] = 1;
  dp[m - 1][0][1] = 2;
  dp[m - 1][1][0] = 2;
  for (long long int i = m - 2; i >= 2; i--) {
    dp[i][0][0] = dp[i + 1][0][1];
    dp[i][0][1] = dp[i + 1][1][1] + dp[i + 1][1][0];
    dp[i][1][0] = dp[i + 1][0][1] + dp[i + 1][0][0];
    dp[i][1][1] = dp[i + 1][1][0];
    dp[i][0][0] %= MOD;
    dp[i][1][0] %= MOD;
    dp[i][0][1] %= MOD;
    dp[i][1][1] %= MOD;
  }
  long long int firstway = (dp[2][0][1] * onetiletwotile(n - 2)) % MOD;
  long long int secondway = dp[2][0][0];
  long long int thirdway = (n >= 2) ? onetiletwotile(n - 3) : 0;
  long long int allways = firstway + secondway + thirdway;
  allways %= MOD;
  allways *= 2;
  allways %= MOD;
  cout << allways;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
