#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 30, Mod = 1e9 + 7;
const long long SQ = 330;
long long f[2][N];
long long sum(long long a, long long b) { return (a + b) % Mod; }
long long sub(long long a, long long b) { return (a - b + Mod) % Mod; }
long long dp[2][N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  f[0][1] = f[1][1] = 1;
  f[0][2] = f[1][2] = 2;
  for (int i = 3; i < N; i++) {
    f[0][i] = sum(f[1][i - 1], f[1][i - 2]);
    f[1][i] = sum(f[0][i - 1], f[0][i - 2]);
  }
  long long n, m;
  cin >> n >> m;
  if (m < n) swap(n, m);
  long long k = sum(f[0][m], f[1][m]);
  long long bad = sub(k, 2);
  long long good = 2;
  dp[0][1] = 2;
  dp[1][1] = bad;
  for (int i = 2; i <= n; i++) {
    dp[0][i] = (dp[0][i - 1] * 2) % Mod;
    dp[1][i] = dp[1][i - 1];
  }
  cout << sum(sum(f[0][n], f[1][n]), dp[1][n]);
  return (0);
}
