#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
const ll mod = 1e9 + 7;
ll pw(ll x, ll a) {
  ll r = 1;
  while (a) {
    if (a & 1) {
      r *= x;
      r %= mod;
    }
    a >>= 1;
    x *= x;
    x %= mod;
  }
  return r;
}
const int MAXN = 1e5 + 5;
int dp[MAXN];
int main() {
  int n, m;
  cin >> n >> m;
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i < MAXN; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  if (m == 1) {
    swap(n, m);
  }
  if (n == 1) {
    if (m == 1) {
      cout << 2 << endl;
      return 0;
    }
    if (m == 2) {
      cout << 4 << endl;
      return 0;
    }
    cout << (dp[m] * 2) % mod << endl;
    return 0;
  }
  cout << (dp[n] * 2 + dp[m] * 2 - 2) % mod << endl;
}
