#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long n, k, t, m, q, flag = 0;
long long po(long long k, long long n, long long ans, long long temp,
             long long ans1) {
  if (n == 0) return ans;
  while (temp <= n) {
    ans *= ans1;
    ans %= mod;
    ans1 = ans1 * ans1;
    ans1 %= mod;
    n = n - temp;
    temp *= 2;
  }
  return po(k, n, ans, 1, k) % mod;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    cin >> n >> m;
    long long a = 1, b = 1, c = 0, d = 0;
    for (int i = 1; i < n; i++) {
      long long t1 = a, t2 = b;
      a = b + d;
      a %= mod;
      b %= mod;
      b = t1 + c;
      c = t1;
      d = t2;
    }
    long long an = a + b + c + d;
    an %= mod;
    a = 1, b = 1, c = 0, d = 0;
    for (int i = 1; i < m; i++) {
      long long t1 = a, t2 = b;
      a = b + d;
      a %= mod;
      b %= mod;
      b = t1 + c;
      c = t1;
      d = t2;
    }
    an += a + b + c + d;
    an %= mod;
    cout << an - 2;
  }
  return 0;
}
