#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = acos(-1.0);
const double epsilon = PI / 180.0;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 2e5 + 10, M = 1e6 + 10;
int n, m;
long long f[N][2][2], f1[N][2][2];
int main() {
  cin >> n >> m;
  f[1][0][0] = 1;
  f[1][1][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i + 1][0][0] = (f[i + 1][0][0] + f[i][1][0]) % mod;
    f[i + 1][1][0] = (f[i + 1][1][0] + f[i][0][0]) % mod;
    f[i + 1][0][1] = (f[i + 1][0][1] + f[i][1][0]) % mod;
    f[i + 1][1][1] = (f[i + 1][1][1] + f[i][1][0]) % mod;
    f[i + 1][0][0] = (f[i + 1][0][0] + f[i][1][1]) % mod;
    f[i + 1][1][0] = (f[i + 1][1][0] + f[i][0][1]) % mod;
  }
  long long ans = (f[n][0][0] + f[n][0][1] + f[n][1][0] + f[n][1][1]) % mod;
  f1[1][0][0] = 1;
  f1[1][1][0] = 1;
  for (int i = 1; i <= m; i++) {
    f1[i + 1][0][0] = (f1[i + 1][0][0] + f1[i][1][0]) % mod;
    f1[i + 1][1][0] = (f1[i + 1][1][0] + f1[i][0][0]) % mod;
    f1[i + 1][0][1] = (f1[i + 1][0][1] + f1[i][1][0]) % mod;
    f1[i + 1][1][1] = (f1[i + 1][1][1] + f1[i][1][0]) % mod;
    f1[i + 1][0][0] = (f1[i + 1][0][0] + f1[i][1][1]) % mod;
    f1[i + 1][1][0] = (f1[i + 1][1][0] + f1[i][0][1]) % mod;
  }
  ans = (ans + f1[n][0][0] + f1[n][0][1] + f1[n][1][0] + f1[n][1][1]) % mod;
  cout << ans;
  return 0;
}
