#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 + 99);
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T mpow(T a, T n) {
  T res = 1;
  for (; n; n >>= 1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}
ll dp[100010][2][2] = {};
ll sum(ll n) {
  return (dp[n][0][0] + dp[n][0][1] + dp[n][1][0] + dp[n][1][1]) % mod;
}
signed main() {
  ll m, n;
  cin >> n >> m;
  for (ll j = 0; j < (ll)(2); j++)
    for (ll k = 0; k < (ll)(2); k++) {
      dp[2][j][k] = 1;
    }
  for (ll i = 3; i < (ll)(100010); i++) {
    dp[i][0][0] = dp[i - 1][1][0];
    dp[i][0][1] = dp[i - 1][0][0] + dp[i - 1][1][0];
    dp[i][1][0] = dp[i - 1][0][1] + dp[i - 1][1][1];
    dp[i][1][1] = dp[i - 1][0][1];
    for (ll j = 0; j < (ll)(2); j++)
      for (ll k = 0; k < (ll)(2); k++) {
        dp[i][j][k] %= mod;
      }
  }
  if (n == 1 && m == 1)
    cout << 1 << endl;
  else if (n == 1)
    cout << sum(m) << endl;
  else if (m == 1)
    cout << sum(n) << endl;
  else
    cout << (sum(n) + sum(m) + mod - 2) % mod << endl;
}
