#include <bits/stdc++.h>
using namespace std;
long long int n, m;
long long int F[100005];
long long int fibo(long long int x) {
  if (F[x] != -1) return F[x];
  if (x == 0 || x == 1) {
    return F[0] = F[1] = 1;
  }
  F[x] = fibo(x - 1) + fibo(x - 2);
  F[x] %= 1000000007;
  long long int tt = F[x];
  tt %= 1000000007;
  return tt;
}
int main() {
  memset(F, -1, sizeof(F));
  scanf("%I64d %I64d", &n, &m);
  if (n > m) swap(n, m);
  long long int temp = fibo(m) * 2;
  temp %= 1000000007;
  if (n == 1)
    cout << temp << endl;
  else if (n == 2) {
    temp += 2;
    temp %= 1000000007;
    cout << temp << endl;
  } else if (n == 3) {
    temp += 4;
    temp %= 1000000007;
    cout << temp << endl;
  } else {
    temp += 4;
    long long int a = 2, b = 2;
    for (int i = 4; i <= n; i++) {
      long long int tt = a + b;
      tt %= 1000000007;
      temp += tt;
      temp %= 1000000007;
      a = b;
      b = tt;
    }
    cout << temp << endl;
  }
  return 0;
}
