#include <bits/stdc++.h>
#pragma GCC omptimize("unroll-loops")
#pragma GCC omptimize("BeerOnTheFloor")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const long long mod = 1e9 + 7;
long long fpowmod(long long x, long long y) {
  if (!y) return 1;
  if (y == 1) return x;
  if (y % 2)
    return (fpowmod(x, y - 1) * x) % mod;
  else {
    long long d = fpowmod(x, y >> 1);
    return (d * d) % mod;
  }
}
long long fpow(long long x, long long y) {
  if (!y) return 1;
  if (y == 1) return x;
  if (y % 2)
    return fpow(x, y - 1) * x;
  else {
    long long d = fpow(x, y >> 1);
    return d * d;
  }
}
const int INF32 = 1009000999;
const int SZ = (1 << 18);
const long long INF64 = 4e18;
const long double eps = 1e-12;
long long dp[SZ];
void precalc() {
  dp[1] = 2, dp[2] = 4;
  for (int i = 3; i <= (int)2e5; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
}
void Solve() {
  precalc();
  long long n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  cout << (dp[m] + fpowmod(2ll, n) - 2ll) % mod << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int q = 1;
  while (q--) Solve();
}
